Re: Loading all clases always
| From: | Matthew Weier O'Phinney | Date: | Sun, 23 Jan 2005 05:06:02 +0000 |
| Subject: | Re: Loading all clases always | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-207068@lists.php.net to get a copy of this message | ||
* Chris <listschris@leftbrained.org>:
> You may want to look at the PHP 5 __autoload function:
>
> http://www.php.net/oop5.autoload
These are semi-available in PHP4 as well -- look up 'overload' in the
function reference.
> I know it's not the answer to your question, but it could be just as
> good, or better, than what you were looking for.
The OP might also want to look up the INI variable 'auto_prepend_file'
if they really *do* want to load all classes on each page call -- this
would eliminate the need to modify all scripts in the web tree. It could
also be used with the overload/__autoload functions (PHP4 or PHP5) --
the auto_prepend_file could contain the __autoload function definition.
> Ben Edwards (lists) wrote:
> > I have all my classes in a single directory. I was thinking of
> > automatically loading them all at the beginning of every page. The
> > logic being that the class definitions will get cached (I guess PHP uses
> > filesize/date/time) so the overhead would not be that great. Also at
> > any given time they will all probably be needed by one of the visitors.
--
Matthew Weier O'Phinney | mailto:matthew@garden.org
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org