Zend Framework: Autoloading for better Performance
Many discussions have come up in the recent past about how ZF should increase the libraries base throughput. One of the suggestions that comes up is whether or not requiring the autoloader, and consequently removing calls to require_once, is a good thing.
The following posts explore these possibilities:
In my codes I use something like this:
if (class_exists(‘NameSpace_SomeClass’)){
require ‘NameSpace/SomeClass.php’;
}
My observations are that this is better (as performance) than require_once.
Radoslav Stankov
November 1, 2008 at 10:19 pm
Remember to set the second argument of class_exists() to false.
Federico
November 2, 2008 at 12:04 pm
I suppose it should be something like:
if (!class_exists(‘NameSpace_SomeClass’, false)){
require ‘NameSpace/SomeClass.php’;
}
Marco
November 3, 2008 at 11:01 am