Update init_autoloader.php
authorYonmaN <yonmanm@gmail.com>
Mon, 3 Sep 2012 11:57:15 +0000 (14:57 +0300)
committerYonmaN <yonmanm@gmail.com>
Mon, 3 Sep 2012 11:57:15 +0000 (14:57 +0300)
Found it handy to allow an application to have the zf2 path specified through the php.ini file or some other ini in scandir. These can be also cascaded and managed centrally which is also nice when you can't specify an environment variable.

init_autoloader.php

index d9f6042..5552eea 100644 (file)
@@ -22,7 +22,10 @@ if (file_exists('vendor/autoload.php')) {
 }
 
 // Support for ZF2_PATH environment variable or git submodule
-if (($zf2Path = getenv('ZF2_PATH') ?: (is_dir('vendor/ZF2/library') ? 'vendor/ZF2/library' : false)) !== false) {
+if (($zf2Path = getenv('ZF2_PATH') ?: 
+    // Support for zf2_path ini directive
+    (get_cfg_var('zf2_path') ?: 
+        (is_dir('vendor/ZF2/library') ? 'vendor/ZF2/library' : false)) !== false)) {
     if (isset($loader)) {
         $loader->add('Zend', $zf2Path . '/Zend');
     } else {