diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-12 08:14:10 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-12 08:14:10 +0100 |
commit | 5fe23e863b79fe03fb8e73f7c77bd1c75f4de12d (patch) | |
tree | b2fbb0e5e09dbe68494e356174c74f2806913002 /system/helpers/inflector_helper.php | |
parent | 0aa9f2e86124194cd64fde098ba7a4169625d353 (diff) | |
parent | 3d933b6fad72d4b92f18187dd57f1d3c35f8936a (diff) |
Merge changes from upstream and fix _limit()
Diffstat (limited to 'system/helpers/inflector_helper.php')
-rw-r--r-- | system/helpers/inflector_helper.php | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 02c425b8a..9cf015d2b 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -2,7 +2,7 @@ /** * CodeIgniter * - * An open source application development framework for PHP 5.1.6 or newer + * An open source application development framework for PHP 5.2.4 or newer * * NOTICE OF LICENSE * @@ -25,8 +25,6 @@ * @filesource */ -// ------------------------------------------------------------------------ - /** * CodeIgniter Inflector Helpers * @@ -37,7 +35,6 @@ * @link http://codeigniter.com/user_guide/helpers/inflector_helper.html */ - // -------------------------------------------------------------------- /** @@ -58,7 +55,7 @@ if ( ! function_exists('singular')) { return $result; } - + $singular_rules = array( '/(matr)ices$/' => '\1ix', '/(vert|ind)ices$/' => '\1ex', @@ -116,7 +113,7 @@ if ( ! function_exists('singular')) if ( ! function_exists('plural')) { function plural($str, $force = FALSE) - { + { $result = strval($str); if ( ! is_countable($result)) @@ -145,7 +142,7 @@ if ( ! function_exists('plural')) '/s$/' => 's', // no change (compatibility) '/$/' => 's', ); - + foreach ($plural_rules as $rule => $replacement) { if (preg_match($rule, $result)) @@ -173,7 +170,7 @@ if ( ! function_exists('camelize')) { function camelize($str) { - return substr(str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', $str))), 1); + return str_replace(' ', '', ucwords(preg_replace('/[\s_]+/', ' ', strtolower($str)))); } } @@ -232,4 +229,4 @@ if ( ! function_exists('is_countable')) } /* End of file inflector_helper.php */ -/* Location: ./system/helpers/inflector_helper.php */
\ No newline at end of file +/* Location: ./system/helpers/inflector_helper.php */ |