mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-03 10:02:42 +00:00
Merge pull request #3259 from dereuromark/2.5-array-merge
microptimize options and default merge and other string key array merges
This commit is contained in:
commit
caf0217fe0
38 changed files with 127 additions and 139 deletions
|
@ -480,10 +480,10 @@ class Router {
|
|||
}
|
||||
|
||||
if ($named === true || $named === false) {
|
||||
$options = array_merge(array('default' => $named, 'reset' => true, 'greedy' => $named), $options);
|
||||
$options += array('default' => $named, 'reset' => true, 'greedy' => $named);
|
||||
$named = array();
|
||||
} else {
|
||||
$options = array_merge(array('default' => false, 'reset' => false, 'greedy' => true), $options);
|
||||
$options += array('default' => false, 'reset' => false, 'greedy' => true);
|
||||
}
|
||||
|
||||
if ($options['reset'] || self::$_namedConfig['rules'] === false) {
|
||||
|
@ -532,11 +532,11 @@ class Router {
|
|||
*/
|
||||
public static function mapResources($controller, $options = array()) {
|
||||
$hasPrefix = isset($options['prefix']);
|
||||
$options = array_merge(array(
|
||||
$options += array(
|
||||
'connectOptions' => array(),
|
||||
'prefix' => '/',
|
||||
'id' => self::ID . '|' . self::UUID
|
||||
), $options);
|
||||
);
|
||||
|
||||
$prefix = $options['prefix'];
|
||||
$connectOptions = $options['connectOptions'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue