so I know that in Zend Framework if your function name follows certain path convention, eg. Path_To_Function::function() when the function is located in path/to/function (or something to this nature), ZF will automatically include the required file in that location
but that’s not what I do….what I do is basically put all the places where I want to include into the php include_path and then just require the file and then call the function.
like the following
require_once('Class.php');
Class::something();
whereby Class.php is inside a directory within the include_path
but then this is redundant since I’m already specifying the class name in the static function call Class::something() and virtually all my functions are static…
is there a way to configure/hack zend so that if I make a static call:
SomeClass::dosomething();
it will automatically execute require_once('SomeClass.php') based on that static call’s class name?
Put this in your
BootstrapclassSee http://framework.zend.com/manual/en/zend.loader.autoloader.html#zend.loader.autoloader.usage
Really, you should be namespacing your classes as this not only makes autoloading easier, but prevents possible conflicts, eg
then you just add the namespace prefixes to the autoloader in your application config