Merge remote-tracking branch 'ocramius/move-view-helpers-setup-to-module-config'
authorEvan Coury <me@evancoury.com>
Wed, 7 Mar 2012 07:45:14 +0000 (00:45 -0700)
committerEvan Coury <me@evancoury.com>
Wed, 7 Mar 2012 07:45:14 +0000 (00:45 -0700)
module/Application/autoload_classmap.php
module/Application/src/Application/Controller/ErrorController.php [deleted file]
module/Application/view/layout/layout.phtml
public/.htaccess
public/index.php

index acf5238..156e8bd 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 return array(
     'Application\Controller\IndexController' => __DIR__ . '/src/Application/Controller/IndexController.php',
-    'Application\Controller\ErrorController' => __DIR__ . '/src/Application/Controller/ErrorController.php',
     'Application\Module'                     => __DIR__ . '/Module.php',
 );
diff --git a/module/Application/src/Application/Controller/ErrorController.php b/module/Application/src/Application/Controller/ErrorController.php
deleted file mode 100644 (file)
index d959f98..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-namespace Application\Controller;
-
-use Zend\Mvc\Controller\ActionController,
-    Zend\View\Model\ViewModel;
-
-class ErrorController extends ActionController
-{
-    const ERROR_NO_ROUTE = 404;
-    const ERROR_NO_CONTROLLER = 404;
-
-    public function indexAction()
-    {
-        $error = $this->request->getMetadata('error', false);
-        if (!$error) {
-            $error = array(
-                'type'    => 404,
-                'message' => 'Page not found',
-            );
-        }
-        
-        switch ($error['type']) {
-            case self::ERROR_NO_ROUTE:
-            case self::ERROR_NO_CONTROLLER:
-            default:
-                // 404 error -- controller or action not found
-                $this->response->setStatusCode(404);
-                break;
-        }
-        
-        return new ViewModel(array('message' => $error['message']));
-    }
-}
index 622c108..e719d29 100644 (file)
@@ -25,7 +25,7 @@ echo $this->doctype();
     <meta charset="utf-8">
     <?php echo $this->headTitle('ZF2 Skeleton Application') ?>
 
-    <?php echo $this->headMeta() ?>
+    <?php echo $this->headMeta()->appendName('viewport', 'width=device-width, initial-scale=1.0') ?>
 
     <!-- Le styles -->
     <?php echo $this->headLink() ?>
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);