<?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',
);
+++ /dev/null
-<?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']));
- }
-}
<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() ?>
-SetEnv APPLICATION_ENV development
+SetEnv APPLICATION_ENV local
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
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);