From c6bd897bee3854f99a74cc14c7d20f2f1467f3de Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Sun, 5 Aug 2012 11:27:53 +0000 Subject: Modification de l'outil bake en ligne de commande pour "Routes show". Bug soumis, premier patch un peu pourri soumis aussi, et appliqué par dév principal sur le master git dans la journée ! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///var/svn/2012-php-weave/trunk@15 d972a294-176a-4cf9-8ea1-fcd5b0c30f5c --- .../lib/Cake/Console/Command/ConsoleShell.php | 8 +++++--- poc/poc02-compiling-cake/src/workdir/in/app/Config/routes.php | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/poc/poc02-compiling-cake/src/vendor/cakephp-2.2.1-0-gcc44130/lib/Cake/Console/Command/ConsoleShell.php b/poc/poc02-compiling-cake/src/vendor/cakephp-2.2.1-0-gcc44130/lib/Cake/Console/Command/ConsoleShell.php index ee8f07d..222ee33 100644 --- a/poc/poc02-compiling-cake/src/vendor/cakephp-2.2.1-0-gcc44130/lib/Cake/Console/Command/ConsoleShell.php +++ b/poc/poc02-compiling-cake/src/vendor/cakephp-2.2.1-0-gcc44130/lib/Cake/Console/Command/ConsoleShell.php @@ -64,7 +64,9 @@ class ConsoleShell extends AppShell { foreach ($this->models as $model) { $this->out(" - {$model}"); } - $this->_loadRoutes(); + if (!$this->_loadRoutes()) { + $this->out(__d('cake_console', "There was an error loading the routes config. Please check that the file exists and is free of parse errors.")); + } } /** @@ -299,8 +301,8 @@ class ConsoleShell extends AppShell { $this->out(__d('cake_console', "Routes configuration reloaded, %d routes connected", count($router->routes))); break; case (preg_match("/^routes\s+show/i", $command, $tmp) == true): - $router = Router::getInstance(); - $this->out(implode("\n", Hash::extract($router->routes, '{n}.0'))); + //$router = Router::getInstance(); + $this->out(print_r(Hash::combine(Router::$routes, '{n}.template', '{n}.defaults'))); break; case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true): if ($url = eval('return array' . $tmp[1] . ';')) { diff --git a/poc/poc02-compiling-cake/src/workdir/in/app/Config/routes.php b/poc/poc02-compiling-cake/src/workdir/in/app/Config/routes.php index 38d6f39..ad311e2 100644 --- a/poc/poc02-compiling-cake/src/workdir/in/app/Config/routes.php +++ b/poc/poc02-compiling-cake/src/workdir/in/app/Config/routes.php @@ -32,6 +32,7 @@ */ Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); + Router::connect('/lpo/test/', array('controller' => 'lpoCtrl', 'action' => 'testaction')); /** * Load all plugin routes. See the CakePlugin documentation on * how to customize the loading of plugin routes. -- cgit v1.2.3