From c6bd897bee3854f99a74cc14c7d20f2f1467f3de Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc <ludovic@pouzenc.fr>
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 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'poc/poc02-compiling-cake/src/vendor/cakephp-2.2.1-0-gcc44130/lib/Cake')

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] . ';')) {
-- 
cgit v1.2.3