From 65c9d0621624acf9ae86e8e948c01d9fe693153c Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Thu, 21 Mar 2013 14:16:48 +0100 Subject: [PATCH] Corrections diverses --- config/application.config.php | 1 + module/Application/config/module.config.php | 1 + .../src/Application/Controller/IndexController.php | 7 +++ .../Application/view/application/index/test.phtml | 4 ++ module/Auth/Module.php | 40 ++++++++++++++++ module/Auth/config/autoload_classmap.php | 4 ++ module/Auth/config/module.config.php | 49 ++++++++++++++++++++ .../Auth/src/Auth/Controller/IndexController.php | 21 +++++++++ module/Auth/view/auth/index/index.phtml | 4 ++ server_config/site.alias | 2 +- vendor/zf2biz/Custom/Model/EntityManager.php | 4 +- 11 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 module/Application/view/application/index/test.phtml create mode 100644 module/Auth/Module.php create mode 100644 module/Auth/config/autoload_classmap.php create mode 100644 module/Auth/config/module.config.php create mode 100644 module/Auth/src/Auth/Controller/IndexController.php create mode 100644 module/Auth/view/auth/index/index.phtml diff --git a/config/application.config.php b/config/application.config.php index 6504dea..846b7b7 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -2,6 +2,7 @@ return array( 'modules' => array( 'Application', + 'Auth', ), 'module_listener_options' => array( 'config_glob_paths' => array( diff --git a/module/Application/config/module.config.php b/module/Application/config/module.config.php index a6dd62b..6dff9ae 100644 --- a/module/Application/config/module.config.php +++ b/module/Application/config/module.config.php @@ -81,6 +81,7 @@ return array( 'template_map' => array( 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml', + 'application/index/test' => __DIR__ . '/../view/application/index/test.phtml', 'error/404' => __DIR__ . '/../view/error/404.phtml', 'error/index' => __DIR__ . '/../view/error/index.phtml', ), diff --git a/module/Application/src/Application/Controller/IndexController.php b/module/Application/src/Application/Controller/IndexController.php index a1aafae..0062914 100644 --- a/module/Application/src/Application/Controller/IndexController.php +++ b/module/Application/src/Application/Controller/IndexController.php @@ -18,4 +18,11 @@ class IndexController extends AbstractActionController { return new ViewModel(); } + + public function testAction() + { + return array( + 'name' => 'test: ajout action', + ); + } } diff --git a/module/Application/view/application/index/test.phtml b/module/Application/view/application/index/test.phtml new file mode 100644 index 0000000..bf79ab4 --- /dev/null +++ b/module/Application/view/application/index/test.phtml @@ -0,0 +1,4 @@ +
+

translate('Welcome to %sZend Framework 2%s'), '', '') ?>

+

translate($this->name), '', '') ?>

+
diff --git a/module/Auth/Module.php b/module/Auth/Module.php new file mode 100644 index 0000000..bd0586c --- /dev/null +++ b/module/Auth/Module.php @@ -0,0 +1,40 @@ +getApplication()->getServiceManager()->get('translator'); + $eventManager = $e->getApplication()->getEventManager(); + $moduleRouteListener = new ModuleRouteListener(); + $moduleRouteListener->attach($eventManager); + } + + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\ClassMapAutoloader' => array( + __DIR__ . '/config/autoload_classmap.php', + ), + ); + } + +} diff --git a/module/Auth/config/autoload_classmap.php b/module/Auth/config/autoload_classmap.php new file mode 100644 index 0000000..8e0999f --- /dev/null +++ b/module/Auth/config/autoload_classmap.php @@ -0,0 +1,4 @@ + __DIR__ . '/../src/Auth/Controller/IndexController.php', +); diff --git a/module/Auth/config/module.config.php b/module/Auth/config/module.config.php new file mode 100644 index 0000000..0972b3c --- /dev/null +++ b/module/Auth/config/module.config.php @@ -0,0 +1,49 @@ + array( + 'routes' => array( + 'auth' => array( + 'type' => 'Literal', + 'options' => array( + 'route' => '/login', + 'defaults' => array( + '__NAMESPACE__' => 'Auth\Controller', + 'controller' => 'Index', + 'action' => 'index', + ), + ), + 'may_terminate' => true, + ), + ), + ), + 'controllers' => array( + 'invokables' => array( + 'Auth\Controller\Index' => 'Auth\Controller\IndexController' + ), + ), + 'view_manager' => array( + 'display_not_found_reason' => true, + 'display_exceptions' => true, + 'doctype' => 'HTML5', + 'not_found_template' => 'error/404', + 'exception_template' => 'error/index', + 'template_map' => array( + 'layout/layout' => __DIR__ . '/../../Application/view/layout/layout.phtml', + 'error/404' => __DIR__ . '/../../Application/view/error/404.phtml', + 'error/index' => __DIR__ . '/../../Application/view/error/index.phtml', + 'auth/index/index' => __DIR__ . '/../view/auth/index/index.phtml', + ), + 'template_path_stack' => array( + __DIR__ . '/../view', + ), + ), +); diff --git a/module/Auth/src/Auth/Controller/IndexController.php b/module/Auth/src/Auth/Controller/IndexController.php new file mode 100644 index 0000000..bef5231 --- /dev/null +++ b/module/Auth/src/Auth/Controller/IndexController.php @@ -0,0 +1,21 @@ + +

translate('Welcome to %sZend Framework 2%s'), '', '') ?>

+

translate('Page %sAUTHENTIFICATION%s'), '', '') ?>

+ diff --git a/server_config/site.alias b/server_config/site.alias index f3adcf0..93e8271 100644 --- a/server_config/site.alias +++ b/server_config/site.alias @@ -1,4 +1,4 @@ -Alias /appblanche /var/git/zf2biz/application-blanche/public +Alias /bookzf2 /var/git/zf2biz/application-blanche/public Order deny,allow diff --git a/vendor/zf2biz/Custom/Model/EntityManager.php b/vendor/zf2biz/Custom/Model/EntityManager.php index 62fc9e9..de9806c 100644 --- a/vendor/zf2biz/Custom/Model/EntityManager.php +++ b/vendor/zf2biz/Custom/Model/EntityManager.php @@ -59,7 +59,7 @@ abstract class EntityManager extends AbstractTableGateway $keys[] = "{$k}: {$v}"; } $keys = implode(', ', $keys); - throw new \Exception("cannot get row {{$keys}} in table 'galerie'"); + throw new \Exception("cannot get row {{$keys}} in table '{$this->table}'"); } return $row; } @@ -104,7 +104,7 @@ abstract class EntityManager extends AbstractTableGateway $keys[] = "{$k}: {$v}"; } $keys = implode(', ', $keys); - throw new \Exception("cannot update row {{$keys}} in table 'galerie'"); + throw new \Exception("cannot update row {{$keys}} in table '{$this->table}'"); } } -- 1.7.10.4