3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
6 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
11 * This autoloading setup is really more complicated than it needs to be for most
12 * applications. The added complexity is simply to reduce the time it takes for
13 * new developers to be productive with a fresh skeleton. It allows autoloading
14 * to be correctly configured, regardless of the installation method and keeps
15 * the use of composer completely optional. This setup should work fine for
16 * most users, however, feel free to configure autoloading however you'd like.
19 // Composer autoloading
20 if (file_exists('vendor/autoload.php')) {
21 $loader = include 'vendor/autoload.php';
24 // Support for ZF2_PATH environment variable or git submodule
25 if (($zf2Path = getenv('ZF2_PATH') ?: (is_dir('vendor/ZF2/library') ? 'vendor/ZF2/library' : false)) !== false) {
27 $loader->add('Zend', $zf2Path . '/Zend');
29 include $zf2Path . '/Zend/Loader/AutoloaderFactory.php';
30 Zend\Loader\AutoloaderFactory::factory(array(
31 'Zend\Loader\StandardAutoloader' => array(
32 'autoregister_zf' => true
38 if (!class_exists('Zend\Loader\AutoloaderFactory')) {
39 throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.');