Corrections diverses
authorSébastien CHAZALLET <s.chazallet@gmail.com>
Thu, 21 Mar 2013 13:16:48 +0000 (14:16 +0100)
committerSébastien CHAZALLET <s.chazallet@gmail.com>
Thu, 21 Mar 2013 13:16:48 +0000 (14:16 +0100)
config/application.config.php
module/Application/config/module.config.php
module/Application/src/Application/Controller/IndexController.php
module/Application/view/application/index/test.phtml [new file with mode: 0644]
module/Auth/Module.php [new file with mode: 0644]
module/Auth/config/autoload_classmap.php [new file with mode: 0644]
module/Auth/config/module.config.php [new file with mode: 0644]
module/Auth/src/Auth/Controller/IndexController.php [new file with mode: 0644]
module/Auth/view/auth/index/index.phtml [new file with mode: 0644]
server_config/site.alias
vendor/zf2biz/Custom/Model/EntityManager.php

index 6504dea..846b7b7 100644 (file)
@@ -2,6 +2,7 @@
 return array(
     'modules' => array(
         'Application',
+        'Auth',
     ),
     'module_listener_options' => array(
         'config_glob_paths'    => array(
index a6dd62b..6dff9ae 100644 (file)
@@ -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',
         ),
index a1aafae..0062914 100644 (file)
@@ -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 (file)
index 0000000..bf79ab4
--- /dev/null
@@ -0,0 +1,4 @@
+<div class="hero-unit">
+    <h1><?php echo sprintf($this->translate('Welcome to %sZend Framework 2%s'), '<span class="zf-green">', '</span>') ?></h1>
+    <h2><?php echo sprintf($this->translate($this->name), '<strong>', '</strong>') ?></h2>
+</div>
diff --git a/module/Auth/Module.php b/module/Auth/Module.php
new file mode 100644 (file)
index 0000000..bd0586c
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Application blanche   (http://zf2.biz)
+ * utiise Zend Framework (http://framework.zend.com/)
+ *
+ * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license   http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+namespace Auth;
+
+use Zend\Mvc\ModuleRouteListener;
+use Zend\Mvc\MvcEvent;
+
+class Module
+{
+    public function onBootstrap(MvcEvent $e)
+    {
+        $e->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 (file)
index 0000000..8e0999f
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+return array(
+    'Auth\Controller\IndexController' => __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 (file)
index 0000000..0972b3c
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Application blanche   (http://zf2.biz)
+ * utiise Zend Framework (http://framework.zend.com/)
+ *
+ * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license   http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+return array(
+    'router' => 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 (file)
index 0000000..bef5231
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Zend Framework (http://framework.zend.com/)
+ *
+ * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license   http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+namespace Auth\Controller;
+
+use Zend\Mvc\Controller\AbstractActionController;
+
+
+class IndexController extends AbstractActionController
+{
+    public function indexAction()
+    {
+        return array();
+    }
+}
diff --git a/module/Auth/view/auth/index/index.phtml b/module/Auth/view/auth/index/index.phtml
new file mode 100644 (file)
index 0000000..3cebeba
--- /dev/null
@@ -0,0 +1,4 @@
+<div class="hero-unit">
+    <h1><?php echo sprintf($this->translate('Welcome to %sZend Framework 2%s'), '<span class="zf-green">', '</span>') ?></h1>
+    <h2><?php echo sprintf($this->translate('Page %sAUTHENTIFICATION%s'), '<strong>', '</strong>') ?></h2>
+</div>
index f3adcf0..93e8271 100644 (file)
@@ -1,4 +1,4 @@
-Alias /appblanche /var/git/zf2biz/application-blanche/public
+Alias /bookzf2 /var/git/zf2biz/application-blanche/public
 
 <Directory /var/git/zf2biz/application-blanche/public>
        Order deny,allow
index 62fc9e9..de9806c 100644 (file)
@@ -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}'");
         }
     }