Re: Loading all clases always

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Chris <listschris@xxxxxxxxxxxxxxx>:
> 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@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux