require_once VENDORPATH.'/Zend/Loader/StandardAutoloader.php'; $loader = new Zend\Loader\StandardAutoloader(); $loader->register();
class MyZendAutoloader extends Zend\Loader\StandardAutoloader
{
public function autoload($class)
{
if (substr($class, 0, 4) != 'Zend')
return false;
return parent::autoload($class);
}
}
Autoloader::add_namespace('Zend', VENDORPATH.'Zend', true);
Autoloader::add_classes(array(
// Add classes you want to override here
'Zend\Acl\Acl' => VENDORPATH.'Zend/Acl/Acl.php',
'Zend\Acl\Role' => VENDORPATH.'Zend/Acl/Role.php',
'Zend\Acl\Resource' => VENDORPATH.'Zend/Acl/Resource.php',
'Zend\Acl\Exception' => VENDORPATH.'Zend/Acl/Exception.php',
'Zend\Acl\Exception\InvalidArgumentException' => VENDORPATH.'Zend/Acl/Exception/InvalidArgumentException.php',
'Zend\Acl\Exception\RuntimeException' => VENDORPATH.'Zend/Acl/Exceptio/RuntimeException.php',
'Zend\Acl\Role\GenericRole' => VENDORPATH.'Zend/Acl/Role/GenericRole.php',
'Zend\Acl\Role\Registry' => VENDORPATH.'Zend/Acl/Role/Registry.php',
));
Does first way with Zend Autoloader heavy affecting performance ? What is your way to load PCR-0 vendors, with CamelCase filenames ? \Autoloader::add_namespace('Zend', '/my/path/to/zend', true);
Harro Verton wrote on Tuesday 24th of January 2012:You can add a PSR-0 compliant searchpath to the autoloader using\Autoloader::add_namespace('Zend', '/my/path/to/zend', true);
I've never used it. You might have to do this for every namespace used in the package, I'm not sure how smart the autoloader is in this respect.
\Autoloader::add_namespace('Zend', '/my/path/to/zend'.DS, true);
It looks like you're new here. If you want to get involved, click one of these buttons!