Skip to content

Instantly share code, notes, and snippets.

@Saeven
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Saeven/cae4902dd656466bcff5 to your computer and use it in GitHub Desktop.
Save Saeven/cae4902dd656466bcff5 to your computer and use it in GitHub Desktop.
Adjusted Bootstrap for ZF 2.5 that goes straight to zend-loader rather than the old autoloader factory path.
protected static function initAutoloader()
{
$vendorPath = static::findParentPath('vendor');
if (file_exists($vendorPath . '/autoload.php')) {
include $vendorPath . '/autoload.php';
}
include $vendorPath . '/zendframework/zend-loader/src/AutoloaderFactory.php';
AutoloaderFactory::factory(array(
'Zend\Loader\StandardAutoloader' => array(
'autoregister_zf' => true,
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__,
),
),
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment