Skip to content

Commit

Permalink
Merge branch '2.0' of github.com:cakephp/cakephp into feature/2.0/pdo
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Nov 9, 2010
2 parents f93a759 + 8c2f9e1 commit 9caba98
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion cake/dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected function _invoke(&$controller, $request) {
'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) {
Expand Down
8 changes: 4 additions & 4 deletions cake/libs/cake_session.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static function delete($name) {
* @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])) {
Expand All @@ -298,7 +298,7 @@ function __overwrite(&$old, $new) {
* @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 {
Expand Down Expand Up @@ -650,7 +650,7 @@ protected static function _defaultConfig($name) {
*
* @return boolean Success
*/
protected function _startSession() {
protected static function _startSession() {
if (headers_sent()) {
if (empty($_SESSION)) {
$_SESSION = array();
Expand Down Expand Up @@ -723,7 +723,7 @@ public static function renew() {
* @return void
* @access private
*/
function __setError($errorNumber, $errorMessage) {
private static function __setError($errorNumber, $errorMessage) {
if (self::$error === false) {
self::$error = array();
}
Expand Down
38 changes: 19 additions & 19 deletions cake/libs/class_registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down Expand Up @@ -94,7 +94,7 @@ public static function &getInstance() {
* @return object instance of ClassName
*/
public static function &init($class, $type = null) {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$id = $false = false;
$true = true;

Expand Down Expand Up @@ -129,21 +129,21 @@ public static function &init($class, $type = null) {
}
$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';
} else {
$appModel = 'AppModel';
}
$settings['name'] = $class;
${$class} =& new $appModel($settings);
${$class} = new $appModel($settings);
}

if (!isset(${$class})) {
Expand Down Expand Up @@ -176,10 +176,10 @@ public static function &init($class, $type = null) {
* @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;
Expand All @@ -192,7 +192,7 @@ public static function addObject($key, &$object) {
* @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]);
Expand All @@ -206,7 +206,7 @@ public static function removeObject($key) {
* @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;
Expand All @@ -222,7 +222,7 @@ public static function isKeySet($key) {
* @return array Set of keys stored in registry
*/
public static function keys() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
return array_keys($_this->__objects);
}

Expand All @@ -233,15 +233,15 @@ public static function keys() {
* @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;
Expand All @@ -257,7 +257,7 @@ public static function &getObject($key) {
* 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;
Expand All @@ -280,9 +280,9 @@ public static function config($type, $param = array()) {
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);
}
Expand All @@ -296,7 +296,7 @@ private function &__duplicate($alias, $class) {
* @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])) {
Expand All @@ -310,7 +310,7 @@ public static function map($key, $name) {
* @return array Keys of registry's map
*/
public static function mapKeys() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
return array_keys($_this->__map);
}

Expand All @@ -332,7 +332,7 @@ private function __getMap($key) {
* @return void
*/
public static function flush() {
$_this =& ClassRegistry::getInstance();
$_this = ClassRegistry::getInstance();
$_this->__objects = array();
$_this->__map = array();
}
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ private static function __mapped($name, $type, $plugin) {
* @param string $name Class name to overload
* @access private
*/
private function __overload($type, $name, $parent) {
private static function __overload($type, $name, $parent) {

}

Expand Down
6 changes: 3 additions & 3 deletions cake/libs/debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
return;
}

$_this =& Debugger::getInstance();
$_this = Debugger::getInstance();

if (empty($file)) {
$file = '[internal]';
Expand Down Expand Up @@ -327,7 +327,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
* @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,
Expand Down Expand Up @@ -551,7 +551,7 @@ protected static function _object($var) {
* @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)) {
Expand Down
10 changes: 5 additions & 5 deletions cake/libs/i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand All @@ -110,7 +110,7 @@ public static function &getInstance() {
* @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);
Expand Down Expand Up @@ -190,7 +190,7 @@ public static function translate($singular, $plural = null, $domain = null, $cat
* @return void
*/
public static function clear() {
$self =& I18n::getInstance();
$self = I18n::getInstance();
$self->__domains = array();
}

Expand All @@ -200,7 +200,7 @@ public static function clear() {
* @return array
*/
public static function domains() {
$self =& I18n::getInstance();
$self = I18n::getInstance();
return $self->__domains;
}

Expand Down
24 changes: 12 additions & 12 deletions cake/libs/model/connection_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand All @@ -74,7 +74,7 @@ public static function &getInstance() {
static $instance = array();

if (!$instance) {
$instance[0] =& new ConnectionManager();
$instance[0] = new ConnectionManager();
}

return $instance[0];
Expand All @@ -87,10 +87,10 @@ public static function &getInstance() {
* @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;
}

Expand All @@ -107,10 +107,10 @@ public static function &getDataSource($name) {
$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;
}

Expand All @@ -120,7 +120,7 @@ public static function &getDataSource($name) {
* @return array List of available connections
*/
public static function sourceList() {
$_this =& ConnectionManager::getInstance();
$_this = ConnectionManager::getInstance();
return array_keys($_this->_dataSources);
}

Expand All @@ -134,7 +134,7 @@ public static function sourceList() {
* 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;
Expand All @@ -152,7 +152,7 @@ public static function getSourceName(&$source) {
* @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;
Expand Down Expand Up @@ -185,7 +185,7 @@ public static function loadDataSource($connName) {
* (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;
}

Expand All @@ -197,15 +197,15 @@ public static function enumConnectionObjects() {
* @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;
return $null;
}
$_this->config->{$name} = $config;
$_this->_connectionsEnum[$name] = $_this->__connectionData($config);
$return =& $_this->getDataSource($name);
$return = $_this->getDataSource($name);
return $return;
}

Expand Down
4 changes: 2 additions & 2 deletions cake/libs/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ public static function parse($url) {
* @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) {
Expand Down Expand Up @@ -563,7 +563,7 @@ function __parseExtension($url) {
* @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) {
Expand Down

0 comments on commit 9caba98

Please sign in to comment.