Browse Source

Making shells run again

José Lorenzo Rodríguez 15 years ago
parent
commit
e3690ebccb
29 changed files with 28 additions and 29 deletions
  1. 4 4
      lib/Cake/Console/Command/CommandListShell.php
  2. 2 2
      lib/Cake/Console/ConsoleErrorHandler.php
  3. 5 4
      lib/Cake/Console/ConsoleOptionParser.php
  4. 5 4
      lib/Cake/Console/Shell.php
  5. 5 8
      lib/Cake/Console/ShellDispatcher.php
  6. 1 1
      lib/Cake/Console/TaskCollection.php
  7. 1 1
      lib/Cake/Console/cake.php
  8. 1 1
      lib/Cake/Core/App.php
  9. 1 1
      lib/Cake/Core/Configure.php
  10. 1 1
      lib/Cake/I18n/L10n.php
  11. 2 2
      lib/Cake/bootstrap.php
  12. 0 0
      lib/Cake/config/config.php
  13. 0 0
      lib/Cake/config/unicode/casefolding/0080_00ff.php
  14. 0 0
      lib/Cake/config/unicode/casefolding/0100_017f.php
  15. 0 0
      lib/Cake/config/unicode/casefolding/0180_024F.php
  16. 0 0
      lib/Cake/config/unicode/casefolding/0250_02af.php
  17. 0 0
      lib/Cake/config/unicode/casefolding/0370_03ff.php
  18. 0 0
      lib/Cake/config/unicode/casefolding/0400_04ff.php
  19. 0 0
      lib/Cake/config/unicode/casefolding/0500_052f.php
  20. 0 0
      lib/Cake/config/unicode/casefolding/0530_058f.php
  21. 0 0
      lib/Cake/config/unicode/casefolding/1e00_1eff.php
  22. 0 0
      lib/Cake/config/unicode/casefolding/1f00_1fff.php
  23. 0 0
      lib/Cake/config/unicode/casefolding/2100_214f.php
  24. 0 0
      lib/Cake/config/unicode/casefolding/2150_218f.php
  25. 0 0
      lib/Cake/config/unicode/casefolding/2460_24ff.php
  26. 0 0
      lib/Cake/config/unicode/casefolding/2c00_2c5f.php
  27. 0 0
      lib/Cake/config/unicode/casefolding/2c60_2c7f.php
  28. 0 0
      lib/Cake/config/unicode/casefolding/2c80_2cff.php
  29. 0 0
      lib/Cake/config/unicode/casefolding/ff00_ffef.php

+ 4 - 4
lib/Cake/Console/Command/CommandListShell.php

@@ -18,6 +18,8 @@
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
 
+App::uses('Shell', 'Console');
+
 /**
  * Shows a list of commands available from the console.
  *
@@ -111,10 +113,8 @@ class CommandListShell extends Shell {
 				continue;
 			}
 			foreach ($shells as $shell) {
-				if ($shell !== 'shell.php' && $shell !== 'app_shell.php') {
-					$shell = str_replace('.php', '', $shell);
-					$shellList[$shell][$type] = $type;
-				}
+				$shell = str_replace('Shell.php', '', $shell);
+				$shellList[$shell][$type] = $type;
 			}
 		}
 		return $shellList;

+ 2 - 2
lib/Cake/Console/ConsoleErrorHandler.php

@@ -17,8 +17,8 @@
  * @since         CakePHP(tm) v 2.0
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-App::import('Core', 'ErrorHandler');
-require_once 'console_output.php';
+App::uses('ErrorHandler', 'Error');
+App::uses('ConsoleOutput', 'Console');
 
 /**
  * Error Handler for Cake console. Does simple printing of the 

+ 5 - 4
lib/Cake/Console/ConsoleOptionParser.php

@@ -17,10 +17,11 @@
  * @since         CakePHP(tm) v 2.0
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-require_once CONSOLE_LIBS . 'console_input_option.php';
-require_once CONSOLE_LIBS . 'console_input_argument.php';
-require_once CONSOLE_LIBS . 'console_input_subcommand.php';
-require_once CONSOLE_LIBS . 'help_formatter.php';
+App::uses('TaskCollection', 'Console');
+App::uses('ConsoleOutput', 'Console');
+App::uses('ConsoleInput', 'Console');
+App::uses('ConsoleInputOption', 'Console');
+App::uses('ConsoleOptionParser', 'Console');
 
 /**
  * Handles parsing the ARGV in the command line and provides support

+ 5 - 4
lib/Cake/Console/Shell.php

@@ -17,10 +17,11 @@
  * @since         CakePHP(tm) v 1.2.0.5012
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-require_once CONSOLE_LIBS . 'task_collection.php';
-require_once CONSOLE_LIBS . 'console_output.php';
-require_once CONSOLE_LIBS . 'console_input.php';
-require_once CONSOLE_LIBS . 'console_option_parser.php';
+
+App::uses('TaskCollection', 'Console');
+App::uses('ConsoleOutput', 'Console');
+App::uses('ConsoleInput', 'Console');
+App::uses('ConsoleOptionParser', 'Console');
 
 /**
  * Base class for command-line utilities for automating programmer chores.

+ 5 - 8
lib/Cake/Console/ShellDispatcher.php

@@ -133,13 +133,13 @@ class ShellDispatcher {
 		}
 
 		$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
-		require CORE_PATH . 'cake' . DS . 'bootstrap.php';
+		require CORE_PATH . 'Cake' . DS . 'bootstrap.php';
 
 		if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
 			include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
 			App::build();
 		}
-		require_once CONSOLE_LIBS . 'console_error_handler.php';
+		require_once CONSOLE_LIBS . 'ConsoleErrorHandler.php';
 		set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
 		set_error_handler(array('ConsoleErrorHandler', 'handleError'), Configure::read('Error.level'));
 
@@ -209,14 +209,11 @@ class ShellDispatcher {
 	protected function _getShell($shell) {
 		list($plugin, $shell) = pluginSplit($shell, true);
 
-		$loaded = App::import('Shell', $plugin . $shell);
 		$class = Inflector::camelize($shell) . 'Shell';
-	
-		if (!$loaded) {
-			throw new MissingShellFileException(array('shell' => $shell));
-		}
+		$loaded = App::uses($class, $plugin . 'Console/Command');
+
 		if (!class_exists($class)) {
-			throw new MissingShellClassException(array('shell' => $class));
+			throw new MissingShellFileException(array('shell' => $shell));
 		}
 		$Shell = new $class();
 		return $Shell;

+ 1 - 1
lib/Cake/Console/TaskCollection.php

@@ -16,7 +16,7 @@
  * @since         CakePHP(tm) v 2.0
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-App::import('Core', 'ObjectCollection');
+App::uses('ObjectCollection', 'Utility');
 
 class TaskCollection extends ObjectCollection {
 /**

+ 1 - 1
lib/Cake/Console/cake.php

@@ -20,7 +20,7 @@
  * @since         CakePHP(tm) v 1.2.0.5012
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'shell_dispatcher.php');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'ShellDispatcher.php');
 
 return ShellDispatcher::run($argv);
 

+ 1 - 1
lib/Cake/Core/App.php

@@ -354,7 +354,7 @@ class App {
 			$paths['helpers'][] = $libs . 'view' . DS . 'helpers' . DS;
 			$paths['plugins'][] = $path . 'plugins' . DS;
 			$paths['vendors'][] = $path . 'vendors' . DS;
-			$paths['shells'][] = $cake . 'console' . DS . 'shells' . DS;
+			$paths['shells'][] = $libs . 'Console' . DS . 'Command' . DS;
 			// Provide BC path to vendors/shells
 			$paths['shells'][] = $path . 'vendors' . DS . 'shells' . DS;
 		}

+ 1 - 1
lib/Cake/Core/Configure.php

@@ -345,7 +345,7 @@ class Configure {
  */
 	public static function version() {
 		if (!isset(self::$_values['Cake']['version'])) {
-			require(CORE_PATH . 'cake' . DS . 'config' . DS . 'config.php');
+			require(LIBS . 'config' . DS . 'config.php');
 			self::write($config);
 		}
 		return self::$_values['Cake']['version'];

+ 1 - 1
lib/Cake/I18n/L10n.php

@@ -17,7 +17,7 @@
  * @since         CakePHP(tm) v 1.2.0.4116
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
-App::uses('CakeRequest', 'Core');
+App::uses('CakeRequest', 'Network');
 
 /**
  * Localization

+ 2 - 2
lib/Cake/bootstrap.php

@@ -40,7 +40,7 @@ error_reporting(E_ALL & ~E_DEPRECATED);
 /**
  * Path to the cake directory.
  */
-	define('CAKE', CORE_PATH . 'lib' . DS . 'Cake' . DS);
+	define('CAKE', CORE_PATH . 'Cake' . DS);
 
 /**
  * Path to the application's directory.
@@ -126,7 +126,7 @@ if (!defined('CONFIGS')) {
 /**
  * Path to the console libs direcotry.
  */
-	define('CONSOLE_LIBS', CAKE.'console'.DS.'libs'.DS);
+	define('CONSOLE_LIBS', CAKE . 'Console' . DS);
 
 /**
  * Path to the tests directory.

cake/config/config.php → lib/Cake/config/config.php


cake/config/unicode/casefolding/0080_00ff.php → lib/Cake/config/unicode/casefolding/0080_00ff.php


cake/config/unicode/casefolding/0100_017f.php → lib/Cake/config/unicode/casefolding/0100_017f.php


cake/config/unicode/casefolding/0180_024F.php → lib/Cake/config/unicode/casefolding/0180_024F.php


cake/config/unicode/casefolding/0250_02af.php → lib/Cake/config/unicode/casefolding/0250_02af.php


cake/config/unicode/casefolding/0370_03ff.php → lib/Cake/config/unicode/casefolding/0370_03ff.php


cake/config/unicode/casefolding/0400_04ff.php → lib/Cake/config/unicode/casefolding/0400_04ff.php


cake/config/unicode/casefolding/0500_052f.php → lib/Cake/config/unicode/casefolding/0500_052f.php


cake/config/unicode/casefolding/0530_058f.php → lib/Cake/config/unicode/casefolding/0530_058f.php


cake/config/unicode/casefolding/1e00_1eff.php → lib/Cake/config/unicode/casefolding/1e00_1eff.php


cake/config/unicode/casefolding/1f00_1fff.php → lib/Cake/config/unicode/casefolding/1f00_1fff.php


cake/config/unicode/casefolding/2100_214f.php → lib/Cake/config/unicode/casefolding/2100_214f.php


cake/config/unicode/casefolding/2150_218f.php → lib/Cake/config/unicode/casefolding/2150_218f.php


cake/config/unicode/casefolding/2460_24ff.php → lib/Cake/config/unicode/casefolding/2460_24ff.php


cake/config/unicode/casefolding/2c00_2c5f.php → lib/Cake/config/unicode/casefolding/2c00_2c5f.php


cake/config/unicode/casefolding/2c60_2c7f.php → lib/Cake/config/unicode/casefolding/2c60_2c7f.php


cake/config/unicode/casefolding/2c80_2cff.php → lib/Cake/config/unicode/casefolding/2c80_2cff.php


cake/config/unicode/casefolding/ff00_ffef.php → lib/Cake/config/unicode/casefolding/ff00_ffef.php