Skip to content
Permalink
Browse files

Infector::_cache is a protected method and no need be singleton.

  • Loading branch information...
jrbasso authored and lorenzo committed Jan 19, 2010
1 parent d2d19ee commit 8d5acf07067a363adfc45134acfb5a9792c5aa33
Showing with 5 additions and 7 deletions.
  1. +5 −7 cake/libs/inflector.php
@@ -253,19 +253,17 @@ function &getInstance() {
* @access protected
*/
function _cache($type, $key, $value = false) {
$_this =& Inflector::getInstance();
$key = '_' . $key;
$type = '_' . $type;
if ($value !== false) {
$_this->{$type}[$key] = $value;
$this->{$type}[$key] = $value;
return $value;
}
if (!isset($_this->{$type}[$key])) {
if (!isset($this->{$type}[$key])) {
return false;
}
return $_this->{$type}[$key];
return $this->{$type}[$key];
}
/**
@@ -328,8 +326,8 @@ function pluralize($word) {
}
if (!isset($_this->_plural['cacheUninflected']) || !isset($_this->_plural['cacheIrregular'])) {
$_this->_plural['cacheUninflected'] = '(?:' . join( '|', $_this->_plural['merged']['uninflected']) . ')';
$_this->_plural['cacheIrregular'] = '(?:' . join( '|', array_keys($_this->_plural['merged']['irregular'])) . ')';
$_this->_plural['cacheUninflected'] = '(?:' . implode('|', $_this->_plural['merged']['uninflected']) . ')';
$_this->_plural['cacheIrregular'] = '(?:' . implode('|', array_keys($_this->_plural['merged']['irregular'])) . ')';
}
if (preg_match('/(.*)\\b(' . $_this->_plural['cacheIrregular'] . ')$/i', $word, $regs)) {

0 comments on commit 8d5acf0

Please sign in to comment.
You can’t perform that action at this time.