Browse Source

Updated App folder

Juan Basso 14 years ago
parent
commit
2f598d4e35

+ 2 - 2
.gitignore

@@ -1,5 +1,5 @@
-/app/Config
-/app/tmp
+/App/Config
+/App/tmp
 /lib/Cake/Console/Templates/skel/tmp/
 /lib/Cake/Console/Templates/skel/tmp/
 /plugins
 /plugins
 /vendors
 /vendors

+ 3 - 3
.htaccess

@@ -1,5 +1,5 @@
 <IfModule mod_rewrite.c>
 <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteEngine on
-   RewriteRule    ^$ app/webroot/    [L]
-   RewriteRule    (.*) app/webroot/$1 [L]
-</IfModule>
+   RewriteRule    ^$ App/webroot/    [L]
+   RewriteRule    (.*) App/webroot/$1 [L]
+</IfModule>

+ 3 - 1
App/Config/Schema/db_acl.php

@@ -18,6 +18,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config\Schema;
+use Cake\Model\Schema;
 
 
 /*
 /*
  *
  *
@@ -25,7 +27,7 @@
  * cake schema run create DbAcl
  * cake schema run create DbAcl
  *
  *
  */
  */
-class DbAclSchema extends CakeSchema {
+class DbAclSchema extends Schema {
 
 
 	public $name = 'DbAcl';
 	public $name = 'DbAcl';
 
 

+ 3 - 1
App/Config/Schema/i18n.php

@@ -18,6 +18,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config\Schema;
+use Cake\Model\Schema;
 
 
 /*
 /*
  *
  *
@@ -25,7 +27,7 @@
  * cake schema run create i18n
  * cake schema run create i18n
  *
  *
  */
  */
-class i18nSchema extends CakeSchema {
+class i18nSchema extends Schema {
 
 
 	public $name = 'i18n';
 	public $name = 'i18n';
 
 

+ 3 - 1
App/Config/Schema/sessions.php

@@ -18,6 +18,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config\Schema;
+use Cake\Model\Schema;
 
 
 /*
 /*
  *
  *
@@ -25,7 +27,7 @@
  * cake schema run create Sessions
  * cake schema run create Sessions
  *
  *
  */
  */
-class SessionsSchema extends CakeSchema {
+class SessionsSchema extends Schema {
 
 
 	public $name = 'Sessions';
 	public $name = 'Sessions';
 
 

+ 14 - 8
App/Config/bootstrap.php

@@ -22,6 +22,13 @@
  * @since         CakePHP(tm) v 0.10.8.2117
  * @since         CakePHP(tm) v 0.10.8.2117
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config;
+use Cake\Core\App,
+	Cake\Core\Configure,
+	Cake\Core\Plugin,
+	Cake\Cache\Cache,
+	Cake\Log\Log,
+	Cake\Utility\Inflector;
 
 
 /**
 /**
  * Cache Engine Configuration
  * Cache Engine Configuration
@@ -122,11 +129,11 @@ Cache::config('default', array('engine' => 'File'));
 
 
 /**
 /**
  * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
  * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
- * Uncomment one of the lines below, as you need. make sure you read the documentation on CakePlugin to use more
+ * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
  * advanced ways of loading plugins
  * advanced ways of loading plugins
  *
  *
- * CakePlugin::loadAll(); // Loads all plugins at once
- * CakePlugin::load('DebugKit'); //Loads a single plugin named DebugKit
+ * Plugin::loadAll(); // Loads all plugins at once
+ * Plugin::load('DebugKit'); //Loads a single plugin named DebugKit
  *
  *
  */
  */
 
 
@@ -155,14 +162,13 @@ Configure::write('Dispatcher.filters', array(
 /**
 /**
  * Configures default file logging options
  * Configures default file logging options
  */
  */
-App::uses('CakeLog', 'Log');
-CakeLog::config('debug', array(
-	'engine' => 'FileLog',
+Log::config('debug', array(
+	'engine' => 'Cake\Log\Engine\FileLog',
 	'types' => array('notice', 'info', 'debug'),
 	'types' => array('notice', 'info', 'debug'),
 	'file' => 'debug',
 	'file' => 'debug',
 ));
 ));
-CakeLog::config('error', array(
-	'engine' => 'FileLog',
+Log::config('error', array(
+	'engine' => 'Cake\Log\Engine\FileLog',
 	'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
 	'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
 	'file' => 'error',
 	'file' => 'error',
 ));
 ));

+ 14 - 6
App/Config/core.php

@@ -18,6 +18,9 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config;
+use Cake\Core\Configure,
+	Cake\Cache\Cache;
 
 
 /**
 /**
  * CakePHP Debug Level:
  * CakePHP Debug Level:
@@ -37,7 +40,7 @@
 /**
 /**
  * Configure the Error handler used to handle errors for your application.  By default
  * Configure the Error handler used to handle errors for your application.  By default
  * ErrorHandler::handleError() is used.  It will display errors using Debugger, when debug > 0
  * ErrorHandler::handleError() is used.  It will display errors using Debugger, when debug > 0
- * and log errors with CakeLog when debug = 0.
+ * and log errors with Cake Log when debug = 0.
  *
  *
  * Options:
  * Options:
  *
  *
@@ -49,7 +52,7 @@
  * @see ErrorHandler for more information on error handling and configuration.
  * @see ErrorHandler for more information on error handling and configuration.
  */
  */
 	Configure::write('Error', array(
 	Configure::write('Error', array(
-		'handler' => 'ErrorHandler::handleError',
+		'handler' => 'Cake\Error\ErrorHandler::handleError',
 		'level' => E_ALL & ~E_DEPRECATED,
 		'level' => E_ALL & ~E_DEPRECATED,
 		'trace' => true
 		'trace' => true
 	));
 	));
@@ -71,12 +74,17 @@
  * @see ErrorHandler for more information on exception handling and configuration.
  * @see ErrorHandler for more information on exception handling and configuration.
  */
  */
 	Configure::write('Exception', array(
 	Configure::write('Exception', array(
-		'handler' => 'ErrorHandler::handleException',
-		'renderer' => 'ExceptionRenderer',
+		'handler' => 'Cake\Error\ErrorHandler::handleException',
+		'renderer' => 'Cake\Error\ExceptionRenderer',
 		'log' => true
 		'log' => true
 	));
 	));
 
 
 /**
 /**
+ * Application namespace
+ */
+	Configure::write('App.namespace', 'App');
+
+/**
  * Application wide charset encoding
  * Application wide charset encoding
  */
  */
 	Configure::write('App.encoding', 'UTF-8');
 	Configure::write('App.encoding', 'UTF-8');
@@ -155,7 +163,7 @@
  *    that can be used with `session_save_handler`.  Using this option will automatically add `session.save_handler`
  *    that can be used with `session_save_handler`.  Using this option will automatically add `session.save_handler`
  *    to the ini array.
  *    to the ini array.
  * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
  * - `Session.autoRegenerate` - Enabling this setting, turns on automatic renewal of sessions, and
- *    sessionids that change frequently. See CakeSession::$requestCountdown.
+ *    sessionids that change frequently. See Cake\Model\Datasource\Session::$requestCountdown.
  * - `Session.ini` - An associative array of additional ini values to set.
  * - `Session.ini` - An associative array of additional ini values to set.
  *
  *
  * The built in defaults are:
  * The built in defaults are:
@@ -166,7 +174,7 @@
  * - 'cache' - Use the Cache class to save sessions.
  * - 'cache' - Use the Cache class to save sessions.
  *
  *
  * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
  * To define a custom session handler, save it at /app/Model/Datasource/Session/<name>.php.
- * Make sure the class implements `CakeSessionHandlerInterface` and set Session.handler to <name>
+ * Make sure the class implements `Cake\Model\Datasource\Session\SessionHandlerInterface` and set Session.handler to <name>
  *
  *
  * To use database sessions, run the app/Config/Schema/sessions.php schema using
  * To use database sessions, run the app/Config/Schema/sessions.php schema using
  * the cake shell command: cake schema create Sessions
  * the cake shell command: cake schema create Sessions

+ 2 - 0
App/Config/database.php.default

@@ -18,6 +18,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config;
+
 /**
 /**
  * In this file you set up your database connection details.
  * In this file you set up your database connection details.
  *
  *

+ 3 - 1
App/Config/email.php.default

@@ -18,6 +18,8 @@
  * @since         CakePHP(tm) v 2.0.0
  * @since         CakePHP(tm) v 2.0.0
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config;
+
 /**
 /**
  * In this file you set up your send email details.
  * In this file you set up your send email details.
  *
  *
@@ -37,7 +39,7 @@
  * where 'Your' is the name of the transport.
  * where 'Your' is the name of the transport.
  *
  *
  * from =>
  * from =>
- * The origin email. See CakeEmail::from() about the valid values
+ * The origin email. See Cake\Network\Email\Email::from() about the valid values
  *
  *
  */
  */
 class EmailConfig {
 class EmailConfig {

+ 8 - 4
App/Config/routes.php

@@ -20,22 +20,26 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
+namespace App\Config;
+use Cake\Routing\Router,
+	Cake\Core\Plugin;
+
 /**
 /**
  * Here, we are connecting '/' (base path) to controller called 'Pages',
  * Here, we are connecting '/' (base path) to controller called 'Pages',
  * its action called 'display', and we pass a param to select the view file
  * its action called 'display', and we pass a param to select the view file
  * to use (in this case, /app/View/Pages/home.ctp)...
  * to use (in this case, /app/View/Pages/home.ctp)...
  */
  */
-	Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home'));
+	Router::connect('/', array('controller' => 'Pages', 'action' => 'display', 'home'));
 /**
 /**
  * ...and connect the rest of 'Pages' controller's urls.
  * ...and connect the rest of 'Pages' controller's urls.
  */
  */
-	Router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));
+	Router::connect('/pages/*', array('controller' => 'Pages', 'action' => 'display'));
 
 
 /**
 /**
- * Load all plugin routes.  See the CakePlugin documentation on 
+ * Load all plugin routes.  See the Plugin documentation on 
  * how to customize the loading of plugin routes.
  * how to customize the loading of plugin routes.
  */
  */
-	CakePlugin::routes();
+	Plugin::routes();
 
 
 /**
 /**
  * Load the CakePHP default routes. Remove this if you do not want to use
  * Load the CakePHP default routes. Remove this if you do not want to use

+ 2 - 3
App/Controller/AppController.php

@@ -19,8 +19,7 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
-
-App::uses('Controller', 'Controller');
+namespace App\Controller;
 
 
 /**
 /**
  * Application Controller
  * Application Controller
@@ -31,5 +30,5 @@ App::uses('Controller', 'Controller');
  * @package       app.Controller
  * @package       app.Controller
  * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
  * @link http://book.cakephp.org/2.0/en/controllers.html#the-app-controller
  */
  */
-class AppController extends Controller {
+class AppController extends \Cake\Controller\Controller {
 }
 }

+ 2 - 2
App/Controller/PagesController.php

@@ -18,8 +18,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
  */
  */
-
-App::uses('AppController', 'Controller');
+namespace App\Controller;
+use Cake\Utility\Inflector;
 
 
 /**
 /**
  * Static content controller
  * Static content controller

+ 2 - 2
App/Model/AppModel.php

@@ -19,8 +19,8 @@
  * @since         CakePHP(tm) v 0.2.9
  * @since         CakePHP(tm) v 0.2.9
  * @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', 'Model');
+namespace App\Model;
+use Cake\Model\Model;
 
 
 /**
 /**
  * Application model for Cake.
  * Application model for Cake.

+ 3 - 0
App/View/Errors/error400.ctp

@@ -15,6 +15,9 @@
  * @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)
  */
  */
+
+use Cake\Core\Configure;
+
 ?>
 ?>
 <h2><?php echo $name; ?></h2>
 <h2><?php echo $name; ?></h2>
 <p class="error">
 <p class="error">

+ 3 - 0
App/View/Errors/error500.ctp

@@ -15,6 +15,9 @@
  * @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)
  */
  */
+
+use Cake\Core\Configure;
+
 ?>
 ?>
 <h2><?php echo $name; ?></h2>
 <h2><?php echo $name; ?></h2>
 <p class="error">
 <p class="error">

+ 1 - 0
App/View/Layouts/flash.ctp

@@ -15,6 +15,7 @@
  * @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)
  */
  */
+use Cake\Core\Configure;
 ?>
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <html xmlns="http://www.w3.org/1999/xhtml">

+ 10 - 7
App/View/Pages/home.ctp

@@ -15,10 +15,15 @@
  * @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)
  */
  */
+use Cake\Core\Configure,
+	Cake\Utility\Debugger,
+	Cake\Cache\Cache,
+	Cake\Model\ConnectionManager,
+	Cake\Utility\Validation,
+	Cake\Error;
 if (Configure::read('debug') == 0):
 if (Configure::read('debug') == 0):
-	throw new NotFoundException();
+	throw new Error\NotFoundException();
 endif;
 endif;
-App::uses('Debugger', 'Utility');
 ?>
 ?>
 <iframe src="http://cakephp.org/bake-banner" width="830" height="160" style="overflow:hidden; border:none;">
 <iframe src="http://cakephp.org/bake-banner" width="830" height="160" style="overflow:hidden; border:none;">
 	<p>For updates and important announcements, visit http://cakefest.org</p>
 	<p>For updates and important announcements, visit http://cakefest.org</p>
@@ -37,13 +42,13 @@ endif;
 </p>
 </p>
 <p>
 <p>
 <?php
 <?php
-	if (version_compare(PHP_VERSION, '5.2.8', '>=')):
+	if (version_compare(PHP_VERSION, '5.3.3', '>=')):
 		echo '<span class="notice success">';
 		echo '<span class="notice success">';
-			echo __d('cake_dev', 'Your version of PHP is 5.2.8 or higher.');
+			echo __d('cake_dev', 'Your version of PHP is 5.3.3 or higher.');
 		echo '</span>';
 		echo '</span>';
 	else:
 	else:
 		echo '<span class="notice">';
 		echo '<span class="notice">';
-			echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.2.8 or higher to use CakePHP.');
+			echo __d('cake_dev', 'Your version of PHP is too low. You need PHP 5.3.3 or higher to use CakePHP.');
 		echo '</span>';
 		echo '</span>';
 	endif;
 	endif;
 ?>
 ?>
@@ -94,7 +99,6 @@ endif;
 </p>
 </p>
 <?php
 <?php
 if (isset($filePresent)):
 if (isset($filePresent)):
-	App::uses('ConnectionManager', 'Model');
 	try {
 	try {
 		$connected = ConnectionManager::getDataSource('default');
 		$connected = ConnectionManager::getDataSource('default');
 	} catch (Exception $connectionError) {
 	} catch (Exception $connectionError) {
@@ -118,7 +122,6 @@ if (isset($filePresent)):
 </p>
 </p>
 <?php endif;?>
 <?php endif;?>
 <?php
 <?php
-	App::uses('Validation', 'Utility');
 	if (!Validation::alphaNumeric('cakephp')) {
 	if (!Validation::alphaNumeric('cakephp')) {
 		echo '<p><span class="notice">';
 		echo '<p><span class="notice">';
 			echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
 			echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');

+ 6 - 3
App/webroot/index.php

@@ -38,7 +38,7 @@ if (!defined('ROOT')) {
 	define('ROOT', dirname(dirname(dirname(__FILE__))));
 	define('ROOT', dirname(dirname(dirname(__FILE__))));
 }
 }
 /**
 /**
- * The actual directory name for the "app".
+ * The actual directory name for the "App".
  *
  *
  */
  */
 if (!defined('APP_DIR')) {
 if (!defined('APP_DIR')) {
@@ -86,7 +86,10 @@ if (!empty($failed)) {
 	trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
 	trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
 }
 }
 
 
-App::uses('Dispatcher', 'Routing');
+use Cake\Network\Request,
+	Cake\Network\Response,
+	Cake\Routing\Dispatcher,
+	Cake\Core\Configure;
 
 
 $Dispatcher = new Dispatcher();
 $Dispatcher = new Dispatcher();
-$Dispatcher->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
+$Dispatcher->dispatch(new Request(), new Response(array('charset' => Configure::read('App.encoding'))));

+ 4 - 3
App/webroot/test.php

@@ -83,10 +83,11 @@ if (!empty($failed)) {
 	trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
 	trigger_error("CakePHP core could not be found.  Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php.  It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
 }
 }
 
 
+use Cake\Core\Configure,
+	Cake\TestSuite\TestSuiteDispatcher;
+
 if (Configure::read('debug') < 1) {
 if (Configure::read('debug') < 1) {
 	die(__d('cake_dev', 'Debug setting does not allow access to this url.'));
 	die(__d('cake_dev', 'Debug setting does not allow access to this url.'));
 }
 }
 
 
-require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
-
-CakeTestSuiteDispatcher::run();
+TestSuiteDispatcher::run();

+ 1 - 1
index.php

@@ -24,7 +24,7 @@
 /**
 /**
  *  Get Cake's root directory
  *  Get Cake's root directory
  */
  */
-define('APP_DIR', 'app');
+define('APP_DIR', 'App');
 define('DS', DIRECTORY_SEPARATOR);
 define('DS', DIRECTORY_SEPARATOR);
 define('ROOT', dirname(__FILE__));
 define('ROOT', dirname(__FILE__));
 define('WEBROOT_DIR', 'webroot');
 define('WEBROOT_DIR', 'webroot');