Making a function/method private

From: Date: Mon, 26 Mar 2001 00:15:09 +0000
Subject: Making a function/method private
Groups: php.general 
Request: Send a blank email to php-general+get-45542@lists.php.net to get a copy of this message
Hi all, I know that we can't make a class method or variable private in php (I hope this get improved sometimes). But, I'm wondering if anyone has found a smart way to limit that only a certain file can call the function/method from another file. Say, I have the file function_def.inc that has a whole bunch of function in it. I want to make it private. I want that only the file wrapper.inc can use the function inside function.def, by including it. If I have another file, say application.php, and I include function_def.inc in application.php, I want that application.php still cannot use any function defined in function_def.inc. Can I do that? If there is a way to do that, maybe there is a way to make some method in a class private by the putting it in certain file, using this same analogy. I want to do that because I'm developing an API/Wrapper for other developers, and I want to make some methods/functions private, for security reason. Thanks for any help. Reuben D. Budiardja

« previous php.general (#45542) next »