Skip to content

Commit

Permalink
Updated App folder
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed May 26, 2012
1 parent 7bcf1ab commit 2f598d4
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .gitignore
@@ -1,5 +1,5 @@
/app/Config
/app/tmp
/App/Config
/App/tmp
/lib/Cake/Console/Templates/skel/tmp/
/plugins
/vendors
Expand Down
6 changes: 3 additions & 3 deletions .htaccess
@@ -1,5 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
RewriteRule ^$ App/webroot/ [L]
RewriteRule (.*) App/webroot/$1 [L]
</IfModule>
4 changes: 3 additions & 1 deletion App/Config/Schema/db_acl.php
Expand Up @@ -18,14 +18,16 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config\Schema;
use Cake\Model\Schema;

/*
*
* Using the Schema command line utility
* cake schema run create DbAcl
*
*/
class DbAclSchema extends CakeSchema {
class DbAclSchema extends Schema {

public $name = 'DbAcl';

Expand Down
4 changes: 3 additions & 1 deletion App/Config/Schema/i18n.php
Expand Up @@ -18,14 +18,16 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config\Schema;
use Cake\Model\Schema;

/*
*
* Using the Schema command line utility
* cake schema run create i18n
*
*/
class i18nSchema extends CakeSchema {
class i18nSchema extends Schema {

public $name = 'i18n';

Expand Down
4 changes: 3 additions & 1 deletion App/Config/Schema/sessions.php
Expand Up @@ -18,14 +18,16 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config\Schema;
use Cake\Model\Schema;

/*
*
* Using the Schema command line utility
* cake schema run create Sessions
*
*/
class SessionsSchema extends CakeSchema {
class SessionsSchema extends Schema {

public $name = 'Sessions';

Expand Down
22 changes: 14 additions & 8 deletions App/Config/bootstrap.php
Expand Up @@ -22,6 +22,13 @@
* @since CakePHP(tm) v 0.10.8.2117
* @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
Expand Down Expand Up @@ -122,11 +129,11 @@

/**
* 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
*
* 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
*
*/

Expand Down Expand Up @@ -155,14 +162,13 @@
/**
* 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'),
'file' => 'debug',
));
CakeLog::config('error', array(
'engine' => 'FileLog',
Log::config('error', array(
'engine' => 'Cake\Log\Engine\FileLog',
'types' => array('warning', 'error', 'critical', 'alert', 'emergency'),
'file' => 'error',
));
20 changes: 14 additions & 6 deletions App/Config/core.php
Expand Up @@ -18,6 +18,9 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config;
use Cake\Core\Configure,
Cake\Cache\Cache;

/**
* CakePHP Debug Level:
Expand All @@ -37,7 +40,7 @@
/**
* 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
* and log errors with CakeLog when debug = 0.
* and log errors with Cake Log when debug = 0.
*
* Options:
*
Expand All @@ -49,7 +52,7 @@
* @see ErrorHandler for more information on error handling and configuration.
*/
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'handler' => 'Cake\Error\ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
Expand All @@ -71,11 +74,16 @@
* @see ErrorHandler for more information on exception handling and configuration.
*/
Configure::write('Exception', array(
'handler' => 'ErrorHandler::handleException',
'renderer' => 'ExceptionRenderer',
'handler' => 'Cake\Error\ErrorHandler::handleException',
'renderer' => 'Cake\Error\ExceptionRenderer',
'log' => true
));

/**
* Application namespace
*/
Configure::write('App.namespace', 'App');

/**
* Application wide charset encoding
*/
Expand Down Expand Up @@ -155,7 +163,7 @@
* that can be used with `session_save_handler`. Using this option will automatically add `session.save_handler`
* to the ini array.
* - `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.
*
* The built in defaults are:
Expand All @@ -166,7 +174,7 @@
* - 'cache' - Use the Cache class to save sessions.
*
* 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
* the cake shell command: cake schema create Sessions
Expand Down
2 changes: 2 additions & 0 deletions App/Config/database.php.default
Expand Up @@ -18,6 +18,8 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config;

/**
* In this file you set up your database connection details.
*
Expand Down
4 changes: 3 additions & 1 deletion App/Config/email.php.default
Expand Up @@ -18,6 +18,8 @@
* @since CakePHP(tm) v 2.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
namespace App\Config;

/**
* In this file you set up your send email details.
*
Expand All @@ -37,7 +39,7 @@
* where 'Your' is the name of the transport.
*
* 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 {
Expand Down
12 changes: 8 additions & 4 deletions App/Config/routes.php
Expand Up @@ -20,22 +20,26 @@
* @since CakePHP(tm) v 0.2.9
* @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',
* its action called 'display', and we pass a param to select the view file
* 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.
*/
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.
*/
CakePlugin::routes();
Plugin::routes();

/**
* Load the CakePHP default routes. Remove this if you do not want to use
Expand Down
5 changes: 2 additions & 3 deletions App/Controller/AppController.php
Expand Up @@ -19,8 +19,7 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

App::uses('Controller', 'Controller');
namespace App\Controller;

/**
* Application Controller
Expand All @@ -31,5 +30,5 @@
* @package 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 {
}
4 changes: 2 additions & 2 deletions App/Controller/PagesController.php
Expand Up @@ -18,8 +18,8 @@
* @since CakePHP(tm) v 0.2.9
* @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
Expand Down
4 changes: 2 additions & 2 deletions App/Model/AppModel.php
Expand Up @@ -19,8 +19,8 @@
* @since CakePHP(tm) v 0.2.9
* @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.
Expand Down
3 changes: 3 additions & 0 deletions App/View/Errors/error400.ctp
Expand Up @@ -15,6 +15,9 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

use Cake\Core\Configure;

?>
<h2><?php echo $name; ?></h2>
<p class="error">
Expand Down
3 changes: 3 additions & 0 deletions App/View/Errors/error500.ctp
Expand Up @@ -15,6 +15,9 @@
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

use Cake\Core\Configure;

?>
<h2><?php echo $name; ?></h2>
<p class="error">
Expand Down
1 change: 1 addition & 0 deletions App/View/Layouts/flash.ctp
Expand Up @@ -15,6 +15,7 @@
* @since CakePHP(tm) v 0.10.0.1076
* @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">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand Down
17 changes: 10 additions & 7 deletions App/View/Pages/home.ctp
Expand Up @@ -15,10 +15,15 @@
* @since CakePHP(tm) v 0.10.0.1076
* @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):
throw new NotFoundException();
throw new Error\NotFoundException();
endif;
App::uses('Debugger', 'Utility');
?>
<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>
Expand All @@ -37,13 +42,13 @@ endif;
</p>
<p>
<?php
if (version_compare(PHP_VERSION, '5.2.8', '>=')):
if (version_compare(PHP_VERSION, '5.3.3', '>=')):
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>';
else:
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>';
endif;
?>
Expand Down Expand Up @@ -94,7 +99,6 @@ endif;
</p>
<?php
if (isset($filePresent)):
App::uses('ConnectionManager', 'Model');
try {
$connected = ConnectionManager::getDataSource('default');
} catch (Exception $connectionError) {
Expand All @@ -118,7 +122,6 @@ if (isset($filePresent)):
</p>
<?php endif;?>
<?php
App::uses('Validation', 'Utility');
if (!Validation::alphaNumeric('cakephp')) {
echo '<p><span class="notice">';
echo __d('cake_dev', 'PCRE has not been compiled with Unicode support.');
Expand Down
9 changes: 6 additions & 3 deletions App/webroot/index.php
Expand Up @@ -38,7 +38,7 @@
define('ROOT', dirname(dirname(dirname(__FILE__))));
}
/**
* The actual directory name for the "app".
* The actual directory name for the "App".
*
*/
if (!defined('APP_DIR')) {
Expand Down Expand Up @@ -86,7 +86,10 @@
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->dispatch(new CakeRequest(), new CakeResponse(array('charset' => Configure::read('App.encoding'))));
$Dispatcher->dispatch(new Request(), new Response(array('charset' => Configure::read('App.encoding'))));
7 changes: 4 additions & 3 deletions App/webroot/test.php
Expand Up @@ -83,10 +83,11 @@
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) {
die(__d('cake_dev', 'Debug setting does not allow access to this url.'));
}

require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';

CakeTestSuiteDispatcher::run();
TestSuiteDispatcher::run();

0 comments on commit 2f598d4

Please sign in to comment.