diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 18:56:01 +0000 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2009-03-17 18:56:01 +0000 |
| commit | 208fc9db683c51e3bcf1f24d1e5e0200e0f32d96 (patch) | |
| tree | 68ef623d8c6e13cc15fc2fe6dbe13a32585b9fa6 /kohana/helpers/inflector.php | |
| parent | 3f87c16223d7aca44f432efe99b35ab7afb0dbe4 (diff) | |
Update Kohana to r4081.
This resolves ticket http://dev.kohanaphp.com/ticket/1156
1156: "Table prefix gets append to column name"
All tests pass.
Diffstat (limited to 'kohana/helpers/inflector.php')
| -rw-r--r-- | kohana/helpers/inflector.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kohana/helpers/inflector.php b/kohana/helpers/inflector.php index b619eddb..94e62d36 100644 --- a/kohana/helpers/inflector.php +++ b/kohana/helpers/inflector.php @@ -26,16 +26,16 @@ class inflector_Core { */ public static function uncountable($str) { - if (self::$uncountable === NULL) + if (inflector::$uncountable === NULL) { // Cache uncountables - self::$uncountable = Kohana::config('inflector.uncountable'); + inflector::$uncountable = Kohana::config('inflector.uncountable'); // Make uncountables mirroed - self::$uncountable = array_combine(self::$uncountable, self::$uncountable); + inflector::$uncountable = array_combine(inflector::$uncountable, inflector::$uncountable); } - return isset(self::$uncountable[strtolower($str)]); + return isset(inflector::$uncountable[strtolower($str)]); } /** @@ -63,19 +63,19 @@ class inflector_Core { // Cache key name $key = 'singular_'.$str.$count; - if (isset(self::$cache[$key])) - return self::$cache[$key]; + if (isset(inflector::$cache[$key])) + return inflector::$cache[$key]; if (inflector::uncountable($str)) - return self::$cache[$key] = $str; + return inflector::$cache[$key] = $str; - if (empty(self::$irregular)) + if (empty(inflector::$irregular)) { // Cache irregular words - self::$irregular = Kohana::config('inflector.irregular'); + inflector::$irregular = Kohana::config('inflector.irregular'); } - if ($irregular = array_search($str, self::$irregular)) + if ($irregular = array_search($str, inflector::$irregular)) { $str = $irregular; } @@ -93,7 +93,7 @@ class inflector_Core { $str = substr($str, 0, -1); } - return self::$cache[$key] = $str; + return inflector::$cache[$key] = $str; } /** @@ -120,21 +120,21 @@ class inflector_Core { // Cache key name $key = 'plural_'.$str.$count; - if (isset(self::$cache[$key])) - return self::$cache[$key]; + if (isset(inflector::$cache[$key])) + return inflector::$cache[$key]; if (inflector::uncountable($str)) - return self::$cache[$key] = $str; + return inflector::$cache[$key] = $str; - if (empty(self::$irregular)) + if (empty(inflector::$irregular)) { // Cache irregular words - self::$irregular = Kohana::config('inflector.irregular'); + inflector::$irregular = Kohana::config('inflector.irregular'); } - if (isset(self::$irregular[$str])) + if (isset(inflector::$irregular[$str])) { - $str = self::$irregular[$str]; + $str = inflector::$irregular[$str]; } elseif (preg_match('/[sxz]$/', $str) OR preg_match('/[^aeioudgkprt]h$/', $str)) { @@ -151,7 +151,7 @@ class inflector_Core { } // Set the cache and return - return self::$cache[$key] = $str; + return inflector::$cache[$key] = $str; } /** |
