Add conditional check for allowing ZF2_PATH env variable to be used
authorEvan Coury <me@evancoury.com>
Wed, 13 Jun 2012 16:43:51 +0000 (09:43 -0700)
committerEvan Coury <me@evancoury.com>
Wed, 13 Jun 2012 16:43:51 +0000 (09:43 -0700)
public/index.php

index ece1222..6685f6f 100644 (file)
@@ -1,9 +1,16 @@
 <?php
-use Zend\ServiceManager\ServiceManager,
-    Zend\Mvc\Service\ServiceManagerConfiguration;
+use Zend\Loader\AutoloaderFactory;
+use Zend\ServiceManager\ServiceManager;
+use Zend\Mvc\Service\ServiceManagerConfiguration;
 
 chdir(dirname(__DIR__));
 
+// Allow using an alternative copy of ZF2
+if (getenv('ZF2_PATH')) {
+    require_once getenv('ZF2_PATH') . '/Zend/Loader/AutoloaderFactory.php';
+    AutoloaderFactory::factory();
+}
+
 // Composer autoloading
 if (!include_once('vendor/autoload.php')) {
     throw new RuntimeException('vendor/autoload.php could not be found. Did you run `php composer.phar install`?');