Re: another question on setting include paths for a project
| From: | larry@garfieldtech.com | Date: | Mon, 22 Mar 2010 15:28:18 +0000 |
| Subject: | Re: another question on setting include paths for a project | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-303091@lists.php.net to get a copy of this message | ||
On 3/22/10 10:25 AM, Paul M Foster wrote:
That's the key. You can do anything you want inside __autoload(). If you must consult something in the environment, there are a couple of ways to do it. First, set a variable in the $_SESSION array, and consult it in __autoload(). Second, use a configuration file for your application. Have it in a stable place, and read the values out of it as needed. Consult these in your __autoload() if you like. PaulI'd suggest skipping __autoload() and going straight for spl_autoload_register(), as it does the same thing but is more flexible since you can then have multiple autoload callbacks if necessary. --Larry Garfield