Fixing more shells, and updating code in home.ctp

This commit is contained in:
José Lorenzo Rodríguez 2010-12-07 20:42:50 -04:30
parent 7828f7d2fb
commit 02ad049559
7 changed files with 18 additions and 17 deletions

View file

@ -53,7 +53,7 @@ class ConsoleShell extends Shell {
* *
*/ */
public function initialize() { public function initialize() {
require_once CAKE . 'dispatcher.php'; App::uses('Dispatcher', 'Routing');
$this->Dispatcher = new Dispatcher(); $this->Dispatcher = new Dispatcher();
$this->models = App::objects('model'); $this->models = App::objects('model');
App::import('Model', $this->models); App::import('Model', $this->models);
@ -335,21 +335,20 @@ class ConsoleShell extends Shell {
* @return boolean True if config reload was a success, otherwise false * @return boolean True if config reload was a success, otherwise false
*/ */
protected function _loadRoutes() { protected function _loadRoutes() {
$router = Router::getInstance(); Router::reload();
extract(Router::getNamedExpressions());
$router->reload();
extract($router->getNamedExpressions());
if (!@include(CONFIGS . 'routes.php')) { if (!@include(CONFIGS . 'routes.php')) {
return false; return false;
} }
$router->parse('/'); Router::parse('/');
foreach (array_keys($router->getNamedExpressions()) as $var) { foreach (array_keys(Router::getNamedExpressions()) as $var) {
unset(${$var}); unset(${$var});
} }
for ($i = 0, $len = count($router->routes); $i < $len; $i++) {
$router->routes[$i]->compile(); foreach (Router::$routes as $route) {
$route->compile();
} }
return true; return true;
} }

View file

@ -20,8 +20,8 @@
* @since CakePHP(tm) v 1.2.0.5550 * @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::import('Core', 'File', false); App::uses('File', 'Utility');
App::import('Model', 'CakeSchema', false); App::uses('CakeSchema', 'Model');
/** /**
* Schema is a command-line database management utility for automating programmer chores. * Schema is a command-line database management utility for automating programmer chores.

View file

@ -23,6 +23,7 @@ App::uses('ConsoleInput', 'Console');
App::uses('ConsoleInputOption', 'Console'); App::uses('ConsoleInputOption', 'Console');
App::uses('ConsoleInputArgument', 'Console'); App::uses('ConsoleInputArgument', 'Console');
App::uses('ConsoleOptionParser', 'Console'); App::uses('ConsoleOptionParser', 'Console');
App::uses('HelpFormatter', 'Console');
/** /**
* Handles parsing the ARGV in the command line and provides support * Handles parsing the ARGV in the command line and provides support

View file

@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0 * @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::import('String', 'Utility'); App::uses('String', 'Utility');
/** /**
* HelpFormatter formats help for console shells. Can format to either * HelpFormatter formats help for console shells. Can format to either

View file

@ -17,8 +17,9 @@
* @since CakePHP(tm) v 1.2.0.5550 * @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('Model', 'Core'); App::uses('Model', 'Model');
App::uses('ConnectionManager', 'Core'); App::uses('AppModel', 'Model');
App::uses('ConnectionManager', 'Model');
/** /**
* Base Class for Schema management * Base Class for Schema management

View file

@ -22,7 +22,7 @@
* Included libraries. * Included libraries.
* *
*/ */
App::uses('File', 'Utility'); App::uses('Folder', 'Utility');
/** /**
* Convenience class for reading, writing and appending to files. * Convenience class for reading, writing and appending to files.

View file

@ -16,14 +16,14 @@
* @since CakePHP(tm) v 0.10.0.1076 * @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
if (Configure::read() == 0): if (Configure::read('debug') == 0):
throw new NotFoundException(); throw new NotFoundException();
endif; endif;
?> ?>
<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2> <h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a> <a href="http://cakephp.org/changelogs/1.3.6"><?php __('Read the changelog'); ?> </a>
<?php <?php
if (Configure::read() > 0): if (Configure::read('debug') > 0):
Debugger::checkSecurityKeys(); Debugger::checkSecurityKeys();
endif; endif;
?> ?>