Merge branch '2.0' of github.com:cakephp/cakephp into feature/2.0/pdo

This commit is contained in:
José Lorenzo Rodríguez 2010-11-08 22:40:09 -04:30
commit 9caba98780
8 changed files with 47 additions and 47 deletions

View file

@ -189,7 +189,7 @@ class Dispatcher {
'action' => $request->params['action']
));
}
$result =& call_user_func_array(array(&$controller, $request->params['action']), $request->params['pass']);
$result = call_user_func_array(array(&$controller, $request->params['action']), $request->params['pass']);
$response = $controller->getResponse();
if ($controller->autoRender) {

View file

@ -278,7 +278,7 @@ class CakeSession {
* @param array $new New set of variable => value
* @access private
*/
function __overwrite(&$old, $new) {
private static function __overwrite(&$old, $new) {
if (!empty($old)) {
foreach ($old as $key => $var) {
if (!isset($new[$key])) {
@ -298,7 +298,7 @@ class CakeSession {
* @return string Error as string
* @access private
*/
function __error($errorNumber) {
private static function __error($errorNumber) {
if (!is_array(self::$error) || !array_key_exists($errorNumber, self::$error)) {
return false;
} else {
@ -650,7 +650,7 @@ class CakeSession {
*
* @return boolean Success
*/
protected function _startSession() {
protected static function _startSession() {
if (headers_sent()) {
if (empty($_SESSION)) {
$_SESSION = array();
@ -723,7 +723,7 @@ class CakeSession {
* @return void
* @access private
*/
function __setError($errorNumber, $errorMessage) {
private static function __setError($errorNumber, $errorMessage) {
if (self::$error === false) {
self::$error = array();
}

View file

@ -64,7 +64,7 @@ class ClassRegistry {
public static function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] =& new ClassRegistry();
$instance[0] = new ClassRegistry();
}
return $instance[0];
}
@ -94,7 +94,7 @@ class ClassRegistry {
* @return object instance of ClassName
*/
public static function &init($class, $type = null) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$id = $false = false;
$true = true;
@ -129,13 +129,13 @@ class ClassRegistry {
}
$alias = $settings['alias'];
if ($model =& $_this->__duplicate($alias, $class)) {
if ($model = $_this->__duplicate($alias, $class)) {
$_this->map($alias, $class);
return $model;
}
if (class_exists($class) || App::import($type, $pluginPath . $class)) {
${$class} =& new $class($settings);
${$class} = new $class($settings);
} elseif ($type === 'Model') {
if ($plugin && class_exists($plugin . 'AppModel')) {
$appModel = $plugin . 'AppModel';
@ -143,7 +143,7 @@ class ClassRegistry {
$appModel = 'AppModel';
}
$settings['name'] = $class;
${$class} =& new $appModel($settings);
${$class} = new $appModel($settings);
}
if (!isset(${$class})) {
@ -176,10 +176,10 @@ class ClassRegistry {
* @return boolean True if the object was written, false if $key already exists
*/
public static function addObject($key, &$object) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$key = Inflector::underscore($key);
if (!isset($_this->__objects[$key])) {
$_this->__objects[$key] =& $object;
$_this->__objects[$key] = $object;
return true;
}
return false;
@ -192,7 +192,7 @@ class ClassRegistry {
* @return void
*/
public static function removeObject($key) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$key = Inflector::underscore($key);
if (isset($_this->__objects[$key])) {
unset($_this->__objects[$key]);
@ -206,7 +206,7 @@ class ClassRegistry {
* @return boolean true if key exists in registry, false otherwise
*/
public static function isKeySet($key) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$key = Inflector::underscore($key);
if (isset($_this->__objects[$key])) {
return true;
@ -222,7 +222,7 @@ class ClassRegistry {
* @return array Set of keys stored in registry
*/
public static function keys() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
return array_keys($_this->__objects);
}
@ -233,15 +233,15 @@ class ClassRegistry {
* @return mixed Object stored in registry or boolean false if the object does not exist.
*/
public static function &getObject($key) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$key = Inflector::underscore($key);
$return = false;
if (isset($_this->__objects[$key])) {
$return =& $_this->__objects[$key];
$return = $_this->__objects[$key];
} else {
$key = $_this->__getMap($key);
if (isset($_this->__objects[$key])) {
$return =& $_this->__objects[$key];
$return = $_this->__objects[$key];
}
}
return $return;
@ -257,7 +257,7 @@ class ClassRegistry {
* the previously-set value of $param, or null if not set.
*/
public static function config($type, $param = array()) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
if (empty($param) && is_array($type)) {
$param = $type;
@ -280,9 +280,9 @@ class ClassRegistry {
private function &__duplicate($alias, $class) {
$duplicate = false;
if ($this->isKeySet($alias)) {
$model =& $this->getObject($alias);
$model = $this->getObject($alias);
if (is_object($model) && (is_a($model, $class) || $model->alias === $class)) {
$duplicate =& $model;
$duplicate = $model;
}
unset($model);
}
@ -296,7 +296,7 @@ class ClassRegistry {
* @param string $name Key that is being mapped
*/
public static function map($key, $name) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$key = Inflector::underscore($key);
$name = Inflector::underscore($name);
if (!isset($_this->__map[$key])) {
@ -310,7 +310,7 @@ class ClassRegistry {
* @return array Keys of registry's map
*/
public static function mapKeys() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
return array_keys($_this->__map);
}
@ -332,7 +332,7 @@ class ClassRegistry {
* @return void
*/
public static function flush() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$_this->__objects = array();
$_this->__map = array();
}

View file

@ -1053,7 +1053,7 @@ class App {
* @param string $name Class name to overload
* @access private
*/
private function __overload($type, $name, $parent) {
private static function __overload($type, $name, $parent) {
}

View file

@ -241,7 +241,7 @@ class Debugger {
return;
}
$_this =& Debugger::getInstance();
$_this = Debugger::getInstance();
if (empty($file)) {
$file = '[internal]';
@ -327,7 +327,7 @@ class Debugger {
* @link http://book.cakephp.org/view/1191/Using-the-Debugger-Class
*/
public static function trace($options = array()) {
$_this =& Debugger::getInstance();
$_this = Debugger::getInstance();
$defaults = array(
'depth' => 999,
'format' => $_this->_outputFormat,
@ -551,7 +551,7 @@ class Debugger {
* @param array $strings Template strings to be used for the output format.
*/
public function output($format = null, $strings = array()) {
$_this =& Debugger::getInstance();
$_this = Debugger::getInstance();
$data = null;
if (is_null($format)) {

View file

@ -92,8 +92,8 @@ class I18n {
public static function &getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] =& new I18n();
$instance[0]->l10n =& new L10n();
$instance[0] = new I18n();
$instance[0]->l10n = new L10n();
}
return $instance[0];
}
@ -110,7 +110,7 @@ class I18n {
* @return string translated string.
*/
public static function translate($singular, $plural = null, $domain = null, $category = 6, $count = null) {
$_this =& I18n::getInstance();
$_this = I18n::getInstance();
if (strpos($singular, "\r\n") !== false) {
$singular = str_replace("\r\n", "\n", $singular);
@ -190,7 +190,7 @@ class I18n {
* @return void
*/
public static function clear() {
$self =& I18n::getInstance();
$self = I18n::getInstance();
$self->__domains = array();
}
@ -200,7 +200,7 @@ class I18n {
* @return array
*/
public static function domains() {
$self =& I18n::getInstance();
$self = I18n::getInstance();
return $self->__domains;
}

View file

@ -60,7 +60,7 @@ class ConnectionManager {
*/
function __construct() {
if (class_exists('DATABASE_CONFIG')) {
$this->config =& new DATABASE_CONFIG();
$this->config = new DATABASE_CONFIG();
$this->_getConnectionObjects();
}
}
@ -74,7 +74,7 @@ class ConnectionManager {
static $instance = array();
if (!$instance) {
$instance[0] =& new ConnectionManager();
$instance[0] = new ConnectionManager();
}
return $instance[0];
@ -87,10 +87,10 @@ class ConnectionManager {
* @return object Instance
*/
public static function &getDataSource($name) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (!empty($_this->_dataSources[$name])) {
$return =& $_this->_dataSources[$name];
$return = $_this->_dataSources[$name];
return $return;
}
@ -107,10 +107,10 @@ class ConnectionManager {
$null = null;
return $null;
}
$_this->_dataSources[$name] =& new $class($_this->config->{$name});
$_this->_dataSources[$name] = new $class($_this->config->{$name});
$_this->_dataSources[$name]->configKeyName = $name;
$return =& $_this->_dataSources[$name];
$return = $_this->_dataSources[$name];
return $return;
}
@ -120,7 +120,7 @@ class ConnectionManager {
* @return array List of available connections
*/
public static function sourceList() {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
return array_keys($_this->_dataSources);
}
@ -134,7 +134,7 @@ class ConnectionManager {
* in the ConnectionManager.
*/
public static function getSourceName(&$source) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
foreach ($_this->_dataSources as $name => $ds) {
if ($ds == $source) {
return $name;
@ -152,7 +152,7 @@ class ConnectionManager {
* @return boolean True on success, null on failure or false if the class is already loaded
*/
public static function loadDataSource($connName) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (is_array($connName)) {
$conn = $connName;
@ -185,7 +185,7 @@ class ConnectionManager {
* (as defined in Connections), and the value is an array with keys 'filename' and 'classname'.
*/
public static function enumConnectionObjects() {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
return $_this->_connectionsEnum;
}
@ -197,7 +197,7 @@ class ConnectionManager {
* @return object A reference to the DataSource object, or null if creation failed
*/
public static function &create($name = '', $config = array()) {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
if (empty($name) || empty($config) || array_key_exists($name, $_this->_connectionsEnum)) {
$null = null;
@ -205,7 +205,7 @@ class ConnectionManager {
}
$_this->config->{$name} = $config;
$_this->_connectionsEnum[$name] = $_this->__connectionData($config);
$return =& $_this->getDataSource($name);
$return = $_this->getDataSource($name);
return $return;
}

View file

@ -506,7 +506,7 @@ class Router {
* @return array Returns an array containing the altered URL and the parsed extension.
* @access private
*/
function __parseExtension($url) {
private static function __parseExtension($url) {
$ext = null;
if (self::$_parseExtensions) {
@ -563,7 +563,7 @@ class Router {
* @return void
* @access private
*/
function __connectDefaultRoutes() {
private static function __connectDefaultRoutes() {
if ($plugins = App::objects('plugin')) {
App::import('Core', 'route/PluginShortRoute');
foreach ($plugins as $key => $value) {