Skip to content

Commit

Permalink
Changing more App::import calls for App::uses
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Dec 3, 2010
1 parent fd639cc commit 1d12984
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 37 deletions.
2 changes: 1 addition & 1 deletion cake/libs/cake_request.php
Expand Up @@ -17,7 +17,7 @@
* @since CakePHP(tm) v 2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Set');
App::uses('Set', 'Core');

/**
* A class that helps wrap Request information and particulars about a single request.
Expand Down
1 change: 0 additions & 1 deletion cake/libs/cake_session.php
Expand Up @@ -141,7 +141,6 @@ class CakeSession {
* @param boolean $start Should session be started right now
*/
public static function init($base = null, $start = true) {
App::import('Core', 'Security');
self::$time = time();

$checkAgent = Configure::read('Session.checkAgent');
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/component.php
Expand Up @@ -16,7 +16,7 @@
* @since CakePHP(tm) v 1.2
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Controller', 'ComponentCollection', false);
App::uses('ComponentCollection', 'Controller');

/**
* Base class for an individual Component. Components provide resuable bits of
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/component_collection.php
Expand Up @@ -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', 'Core');

class ComponentCollection extends ObjectCollection {

Expand Down
6 changes: 3 additions & 3 deletions cake/libs/controller/components/auth.php
Expand Up @@ -20,8 +20,9 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

App::import('Core', 'Router', false);
App::import('Core', 'Security', false);
App::uses('Router', 'Core');
App::uses('Security', 'Core');
App::uses('Debugger', 'Core');

/**
* Authentication control component class
Expand Down Expand Up @@ -287,7 +288,6 @@ public function initialize(Controller $controller, $settings = array()) {
}
}
if (Configure::read('debug') > 0) {
App::import('Debugger');
Debugger::checkSecurityKeys();
}
}
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/components/cookie.php
Expand Up @@ -21,7 +21,7 @@
/**
* Load Security class
*/
App::import('Core', 'Security');
App::uses('Security', 'Core');

/**
* Cookie Component.
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/components/email.php
Expand Up @@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.3467
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Multibyte');
App::uses('Multibyte', 'Core');

/**
* EmailComponent
Expand Down
5 changes: 2 additions & 3 deletions cake/libs/controller/components/request_handler.php
Expand Up @@ -20,6 +20,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

App::uses('Xml', 'Core');

/**
* Request object for handling HTTP requests
*
Expand Down Expand Up @@ -172,9 +174,6 @@ public function startup(&$controller) {
}

if ($this->requestedWith('xml')) {
if (!class_exists('Xml')) {
App::import('Core', 'Xml');
}
try {
$xml = Xml::build(trim(file_get_contents('php://input')));

Expand Down
4 changes: 2 additions & 2 deletions cake/libs/controller/components/security.php
Expand Up @@ -17,8 +17,8 @@
* @since CakePHP(tm) v 0.10.8.2156
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'String', false);
App::import('Core', 'Security', false);
App::uses('String', 'Core');
App::uses('Security', 'Core');

/**
* SecurityComponent
Expand Down
5 changes: 2 additions & 3 deletions cake/libs/controller/components/session.php
Expand Up @@ -17,9 +17,8 @@
* @since CakePHP(tm) v 0.10.0.1232
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
if (!class_exists('cakesession')) {
require LIBS . 'cake_session.php';
}

App::uses('CakeSession', 'Core');

/**
* Session Component.
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/scaffold.php
Expand Up @@ -19,7 +19,7 @@
* @since Cake v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('View', 'Scaffold');
App::uses('Scaffold', 'View');

/**
* Scaffolding is a set of automatic actions for starting web development work faster.
Expand Down
8 changes: 2 additions & 6 deletions cake/libs/debugger.php
Expand Up @@ -24,12 +24,8 @@
* Included libraries.
*
*/
if (!class_exists('CakeLog')) {
require_once LIBS . 'cake_log.php';
}
if (!class_exists('String')) {
require_once LIBS . 'string.php';
}
App::uses('CakeLog', 'Core');
App::uses('String', 'Core');

/**
* Provide custom logging and error handling.
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/dispatcher.php
Expand Up @@ -28,6 +28,7 @@
App::uses('CakeRequest', 'Core');
App::uses('CakeResponse', 'Core');
App::uses('Controller', 'Controller');
App::uses('Scaffold', 'Controller');
App::uses('View', 'View');
App::uses('Debugger', 'Core');

Expand Down Expand Up @@ -163,7 +164,6 @@ protected function _invoke(Controller $controller, CakeRequest $request) {

if (!isset($methods[$request->params['action']])) {
if ($controller->scaffold !== false) {
App::import('Controller', 'Scaffold', false);
return new Scaffold($controller, $request);
}
throw new MissingActionException(array(
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/http_socket.php
Expand Up @@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'CakeSocket');
App::import('Core', 'Router');
App::uses('CakeSocket', 'Core');
App::uses('Router', 'Core');

/**
* Cake network socket connection class.
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/i18n.php
Expand Up @@ -21,8 +21,8 @@
/**
* Included libraries.
*/
App::import('Core', 'L10n');
App::import('Core', 'Multibyte');
App::uses('L10n', 'Core');
App::uses('Multibyte', 'Core');

/**
* I18n handles translation of Text and time format strings.
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/l10n.php
Expand Up @@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.2.0.4116
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'CakeRequest');
App::uses('CakeRequest', 'Core');

/**
* Localization
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/model/behavior_collection.php
Expand Up @@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.0.0
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'ObjectCollection');
App::uses('ObjectCollection', 'Core');

/**
* Model behavior collection class.
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/model/cake_schema.php
Expand Up @@ -17,8 +17,8 @@
* @since CakePHP(tm) v 1.2.0.5550
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
App::import('Core', 'Model');
App::import('Core', 'ConnectionManager');
App::uses('Model', 'Core');
App::uses('ConnectionManager', 'Core');

/**
* Base Class for Schema management
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/model/connection_manager.php
Expand Up @@ -19,8 +19,6 @@
* @since CakePHP(tm) v 0.10.x.1402
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
require LIBS . 'model' . DS . 'datasources' . DS . 'datasource.php';
include_once CONFIGS . 'database.php';

/**
* Manages loaded instances of DataSource objects
Expand Down Expand Up @@ -59,6 +57,7 @@ class ConnectionManager {
*
*/
function __construct() {
include_once CONFIGS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
$this->config = new DATABASE_CONFIG();
$this->_getConnectionObjects();
Expand Down Expand Up @@ -102,6 +101,7 @@ public static function &getDataSource($name) {
$conn = $_this->_connectionsEnum[$name];
$class = $conn['classname'];

require LIBS . 'model' . DS . 'datasources' . DS . 'datasource.php';
if ($_this->loadDataSource($name) === null) {
trigger_error(sprintf(__("ConnectionManager::getDataSource - Could not load class %s"), $class), E_USER_ERROR);
$null = null;
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/router.php
Expand Up @@ -18,8 +18,8 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

App::import('Core', 'CakeRequest');
App::import('Core', 'route/CakeRoute');
App::uses('CakeRequest', 'Core');
App::uses('CakeRoute', 'Core');

/**
* Parses the request URL into controller, action, and parameters.
Expand Down

0 comments on commit 1d12984

Please sign in to comment.