';
- $link = "document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorCode" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
+ echo '
';
+ $link = "document.getElementById(\"CakeErrorCode" . count($this->errors) . "\").style.display = (document.getElementById(\"CakeErrorCode" . count($this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
echo "
Code";
if (!empty($context)) {
- $link = "document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display = (document.getElementById(\"CakeErrorContext" . count($_this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
+ $link = "document.getElementById(\"CakeErrorContext" . count($this->errors) . "\").style.display = (document.getElementById(\"CakeErrorContext" . count($this->errors) . "\").style.display == \"none\" ? \"\" : \"none\")";
echo " |
Context";
if (!empty($helpCode)) {
- echo " |
Help";
+ echo " |
Help";
}
- echo "
errors) . "\" class=\"cake-context\" style=\"display: none;\">";
+ echo "errors) . "\" class=\"cake-context\" style=\"display: none;\">";
echo implode("\n", $context);
echo "
";
}
if (!empty($listing)) {
- echo "errors) . "\" class=\"cake-code-dump\" style=\"display: none;\">";
+ echo "
errors) . "\" class=\"cake-code-dump\" style=\"display: none;\">";
pr(implode("\n", $listing) . "\n", false);
echo '
';
}
@@ -523,7 +521,7 @@ class Debugger extends Object {
echo "Trace:\n" . $trace;
break;
case 'log':
- $_this->log(compact('error', 'code', 'description', 'line', 'file', 'context', 'trace'));
+ $this->log(compact('error', 'code', 'description', 'line', 'file', 'context', 'trace'));
break;
case false:
$this->__data[] = compact('error', 'code', 'description', 'line', 'file', 'context', 'trace');
diff --git a/cake/libs/i18n.php b/cake/libs/i18n.php
index 0d43552ea..48f22ce1e 100644
--- a/cake/libs/i18n.php
+++ b/cake/libs/i18n.php
@@ -431,9 +431,8 @@ class I18n extends Object {
* @access private
*/
function __destruct() {
- $_this =& I18n::getInstance();
- if ($_this->__cache) {
- Cache::write($_this->domain, array_filter($_this->__domains), '_cake_core_');
+ if ($this->__cache) {
+ Cache::write($this->domain, array_filter($this->__domains), '_cake_core_');
}
}
}
diff --git a/cake/libs/inflector.php b/cake/libs/inflector.php
index ef0f11c60..500a2dc40 100644
--- a/cake/libs/inflector.php
+++ b/cake/libs/inflector.php
@@ -145,10 +145,9 @@ class Inflector extends Object {
* Initializes plural inflection rules
*
* @return void
- * @access protected
+ * @access private
*/
function __initPluralRules() {
- $_this =& Inflector::getInstance();
$corePluralRules = array(
'/(s)tatus$/i' => '\1\2tatuses',
'/(quiz)$/i' => '\1zes',
@@ -217,12 +216,12 @@ class Inflector extends Object {
'turf' => 'turfs');
- $pluralRules = Set::pushDiff($_this->__pluralRules, $corePluralRules);
- $uninflected = Set::pushDiff($_this->__uninflectedPlural, $coreUninflectedPlural);
- $irregular = Set::pushDiff($_this->__irregularPlural, $coreIrregularPlural);
+ $pluralRules = Set::pushDiff($this->__pluralRules, $corePluralRules);
+ $uninflected = Set::pushDiff($this->__uninflectedPlural, $coreUninflectedPlural);
+ $irregular = Set::pushDiff($this->__irregularPlural, $coreIrregularPlural);
- $_this->pluralRules = array('pluralRules' => $pluralRules, 'uninflected' => $uninflected, 'irregular' => $irregular);
- $_this->pluralized = array();
+ $this->pluralRules = array('pluralRules' => $pluralRules, 'uninflected' => $uninflected, 'irregular' => $irregular);
+ $this->pluralized = array();
}
/**
* Return $word in plural form.
@@ -276,8 +275,6 @@ class Inflector extends Object {
* @access protected
*/
function __initSingularRules() {
-
- $_this =& Inflector::getInstance();
$coreSingularRules = array(
'/(s)tatuses$/i' => '\1\2tatus',
'/^(.*)(menu)s$/i' => '\1\2',
@@ -355,12 +352,12 @@ class Inflector extends Object {
'trilbys' => 'trilby',
'turfs' => 'turf');
- $singularRules = Set::pushDiff($_this->__singularRules, $coreSingularRules);
- $uninflected = Set::pushDiff($_this->__uninflectedSingular, $coreUninflectedSingular);
- $irregular = Set::pushDiff($_this->__irregularSingular, $coreIrregularSingular);
+ $singularRules = Set::pushDiff($this->__singularRules, $coreSingularRules);
+ $uninflected = Set::pushDiff($this->__uninflectedSingular, $coreUninflectedSingular);
+ $irregular = Set::pushDiff($this->__irregularSingular, $coreIrregularSingular);
- $_this->singularRules = array('singularRules' => $singularRules, 'uninflected' => $uninflected, 'irregular' => $irregular);
- $_this->singularized = array();
+ $this->singularRules = array('singularRules' => $singularRules, 'uninflected' => $uninflected, 'irregular' => $irregular);
+ $this->singularized = array();
}
/**
* Return $word in singular form.
diff --git a/cake/libs/model/connection_manager.php b/cake/libs/model/connection_manager.php
index 30c798926..699309d3c 100644
--- a/cake/libs/model/connection_manager.php
+++ b/cake/libs/model/connection_manager.php
@@ -237,8 +237,6 @@ class ConnectionManager extends Object {
* @access private
*/
function __getDriver($config) {
- $_this =& ConnectionManager::getInstance();
-
if (!isset($config['datasource'])) {
$config['datasource'] = 'dbo';
}
@@ -246,7 +244,7 @@ class ConnectionManager extends Object {
if (isset($config['driver']) && $config['driver'] != null && !empty($config['driver'])) {
$filename = $config['datasource'] . DS . $config['datasource'] . '_' . $config['driver'];
$classname = Inflector::camelize(strtolower($config['datasource'] . '_' . $config['driver']));
- $parent = $_this->__getDriver(array('datasource' => $config['datasource']));
+ $parent = $this->__getDriver(array('datasource' => $config['datasource']));
} else {
$filename = $config['datasource'] . '_source';
$classname = Inflector::camelize(strtolower($config['datasource'] . '_source'));
diff --git a/cake/libs/router.php b/cake/libs/router.php
index e6171a2cb..d880f3880 100644
--- a/cake/libs/router.php
+++ b/cake/libs/router.php
@@ -33,7 +33,6 @@
if (!class_exists('Object')) {
App::import('Core', 'Object');
}
-
/**
* Parses the request URL into controller, action, and parameters.
*
@@ -422,10 +421,10 @@ class Router extends Object {
foreach ($_this->routes as $i => $route) {
if (count($route) === 3) {
- $route = $_this->compile($i);
+ $route = $_this->__compile($i);
}
- if (($r = $_this->matchRoute($route, $url)) !== false) {
+ if (($r = $_this->__matchRoute($route, $url)) !== false) {
$_this->__currentRoute[] = $route;
list($route, $regexp, $names, $defaults, $params) = $route;
$argOptions = array();
@@ -494,17 +493,16 @@ class Router extends Object {
* @return mixed Boolean false on failure, otherwise array
* @access public
*/
- function matchRoute($route, $url) {
+ function __matchRoute($route, $url) {
list($route, $regexp, $names, $defaults) = $route;
if (!preg_match($regexp, $url, $r)) {
return false;
} else {
- $_this =& Router::getInstance();
foreach ($defaults as $key => $val) {
if ($key{0} === '[' && preg_match('/^\[(\w+)\]$/', $key, $header)) {
- if (isset($_this->__headerMap[$header[1]])) {
- $header = $_this->__headerMap[$header[1]];
+ if (isset($this->__headerMap[$header[1]])) {
+ $header = $this->__headerMap[$header[1]];
} else {
$header = 'http_' . $header[1];
}
@@ -531,9 +529,9 @@ class Router extends Object {
*
* @param integer $i
* @return array Returns an array containing the compiled route
- * @access public
+ * @access private
*/
- function compile($i) {
+ function __compile($i) {
$route = $this->routes[$i];
if (!list($pattern, $names) = $this->writeRoute($route[0], $route[1], $route[2])) {
@@ -556,16 +554,15 @@ class Router extends Object {
*/
function __parseExtension($url) {
$ext = null;
- $_this =& Router::getInstance();
- if ($_this->__parseExtensions) {
+ if ($this->__parseExtensions) {
if (preg_match('/\.[0-9a-zA-Z]*$/', $url, $match) === 1) {
$match = substr($match[0], 1);
- if (empty($_this->__validExtensions)) {
+ if (empty($this->__validExtensions)) {
$url = substr($url, 0, strpos($url, '.' . $match));
$ext = $match;
} else {
- foreach ($_this->__validExtensions as $name) {
+ foreach ($this->__validExtensions as $name) {
if (strcasecmp($name, $match) === 0) {
$url = substr($url, 0, strpos($url, '.' . $name));
$ext = $match;
@@ -582,18 +579,17 @@ class Router extends Object {
/**
* Connects the default, built-in routes, including admin routes, and (deprecated) web services
* routes.
- *
+ *
* @return void
* @access private
*/
function __connectDefaultRoutes() {
- $_this =& Router::getInstance();
- if ($_this->__defaultsMapped) {
+ if ($this->__defaultsMapped) {
return;
}
- if ($_this->__admin) {
- $params = array('prefix' => $_this->__admin, $_this->__admin => true);
+ if ($this->__admin) {
+ $params = array('prefix' => $this->__admin, $this->__admin => true);
}
if ($plugins = Configure::listObjects('plugin')) {
@@ -602,25 +598,25 @@ class Router extends Object {
}
$match = array('plugin' => implode('|', $plugins));
- $_this->connect('/:plugin/:controller/:action/*', array(), $match);
+ $this->connect('/:plugin/:controller/:action/*', array(), $match);
- if ($_this->__admin) {
- $_this->connect("/{$_this->__admin}/:plugin/:controller", $params, $match);
- $_this->connect("/{$_this->__admin}/:plugin/:controller/:action/*", $params, $match);
+ if ($this->__admin) {
+ $this->connect("/{$this->__admin}/:plugin/:controller", $params, $match);
+ $this->connect("/{$this->__admin}/:plugin/:controller/:action/*", $params, $match);
}
}
- if ($_this->__admin) {
- $_this->connect("/{$_this->__admin}/:controller", $params);
- $_this->connect("/{$_this->__admin}/:controller/:action/*", $params);
+ if ($this->__admin) {
+ $this->connect("/{$this->__admin}/:controller", $params);
+ $this->connect("/{$this->__admin}/:controller/:action/*", $params);
}
- $_this->connect('/:controller', array('action' => 'index'));
- $_this->connect('/:controller/:action/*');
+ $this->connect('/:controller', array('action' => 'index'));
+ $this->connect('/:controller/:action/*');
- if ($_this->named['rules'] === false) {
- $_this->connectNamed(true);
+ if ($this->named['rules'] === false) {
+ $this->connectNamed(true);
}
- $_this->__defaultsMapped = true;
+ $this->__defaultsMapped = true;
}
/**
* Takes parameter and path information back from the Dispatcher
@@ -825,7 +821,7 @@ class Router extends Object {
foreach ($_this->routes as $i => $route) {
if (count($route) === 3) {
- $route = $_this->compile($i);
+ $route = $_this->__compile($i);
}
$originalUrl = $url;
@@ -1060,10 +1056,9 @@ class Router extends Object {
$count = count($params['named']);
$keys = array_keys($params['named']);
$named = array();
- $_this =& Router::getInstance();
for ($i = 0; $i < $count; $i++) {
- $named[] = $keys[$i] . $_this->named['separator'] . $params['named'][$keys[$i]];
+ $named[] = $keys[$i] . $this->named['separator'] . $params['named'][$keys[$i]];
}
$params['named'] = join('/', $named);
}
diff --git a/cake/libs/validation.php b/cake/libs/validation.php
index 6ba051223..305a2b212 100644
--- a/cake/libs/validation.php
+++ b/cake/libs/validation.php
@@ -946,17 +946,16 @@ class Validation extends Object {
}
/**
* Reset internal variables for another validation run.
- *
+ *
* @return void
* @access private
*/
function __reset() {
- $_this =& Validation::getInstance();
- $_this->check = null;
- $_this->regex = null;
- $_this->country = null;
- $_this->deep = null;
- $_this->type = null;
+ $this->check = null;
+ $this->regex = null;
+ $this->country = null;
+ $this->deep = null;
+ $this->type = null;
}
}
?>
\ No newline at end of file