Merge pull request #39 from gabriel403/master
authorEvan Coury <me@evancoury.com>
Tue, 6 Mar 2012 13:43:14 +0000 (05:43 -0800)
committerEvan Coury <me@evancoury.com>
Tue, 6 Mar 2012 13:43:14 +0000 (05:43 -0800)
Added env check and changed glob line

public/.htaccess
public/index.php

index 361e2e3..dc8c8dc 100644 (file)
@@ -1,4 +1,4 @@
-SetEnv APPLICATION_ENV development
+SetEnv APPLICATION_ENV local
 
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} -s [OR]
index 5e89d16..26eefe6 100644 (file)
@@ -3,11 +3,15 @@ chdir(dirname(__DIR__));
 require_once (getenv('ZF2_PATH') ?: 'vendor/ZendFramework/library') . '/Zend/Loader/AutoloaderFactory.php';
 Zend\Loader\AutoloaderFactory::factory();
 
+if (!($env = getenv('APPLICATION_ENV'))) {
+    $env = 'local';
+}
+
 $appConfig = include 'config/application.config.php';
 
 $listenerOptions  = new Zend\Module\Listener\ListenerOptions($appConfig['module_listener_options']);
 $defaultListeners = new Zend\Module\Listener\DefaultListenerAggregate($listenerOptions);
-$defaultListeners->getConfigListener()->addConfigGlobPath('config/autoload/*.config.php');
+$defaultListeners->getConfigListener()->addConfigGlobPath("config/autoload/{global,$env}.config.php");
 
 $moduleManager = new Zend\Module\Manager($appConfig['modules']);
 $moduleManager->events()->attachAggregate($defaultListeners);