Skip to content

Commit

Permalink
Avoid side effects in Inflector.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Mar 16, 2015
1 parent a3d81a4 commit 3b600d7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -37,7 +37,8 @@
"files": [
"src/Core/functions.php",
"src/Collection/functions.php",
"src/I18n/functions.php"
"src/I18n/functions.php",
"src/Utility/bootstrap.php"
]
},
"autoload-dev": {
Expand Down
3 changes: 0 additions & 3 deletions src/Utility/Inflector.php
Expand Up @@ -754,6 +754,3 @@ public static function slug($string, $replacement = '-')
return preg_replace(array_keys($map), array_values($map), $string);
}
}

// Store the initial state
Inflector::reset();
18 changes: 18 additions & 0 deletions src/Utility/bootstrap.php
@@ -0,0 +1,18 @@
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @since 3.0.0
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Utility\Inflector;

// Store the initial state
Inflector::reset();
3 changes: 2 additions & 1 deletion src/Utility/composer.json
Expand Up @@ -11,7 +11,8 @@
"autoload": {
"psr-4": {
"Cake\\Utility\\": "."
}
},
"files": ["bootstrap.php"]
},
"minimum-stability": "beta"
}

0 comments on commit 3b600d7

Please sign in to comment.