diff --git a/composer.lock b/composer.lock index 9222433feff81..851ef2c8e375c 100644 --- a/composer.lock +++ b/composer.lock @@ -325,16 +325,16 @@ }, { "name": "joomla/registry", - "version": "1.4.2", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", - "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e" + "reference": "730467978ad52677903e973bb33be2306eb161eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/5c2e607ff61f8df07c3c0630ed62a8c3d892469e", - "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/730467978ad52677903e973bb33be2306eb161eb", + "reference": "730467978ad52677903e973bb33be2306eb161eb", "shasum": "" }, "require": { @@ -375,7 +375,7 @@ "joomla", "registry" ], - "time": "2015-03-07 18:48:26" + "time": "2015-03-16 18:49:29" }, { "name": "joomla/session", @@ -508,16 +508,16 @@ }, { "name": "joomla/utilities", - "version": "1.2.0", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/joomla-framework/utilities.git", - "reference": "f749a9bd6f2fc5ad376687651478273dac105051" + "reference": "2e7f37a69162fea02059c764a318a920121f8b4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/f749a9bd6f2fc5ad376687651478273dac105051", - "reference": "f749a9bd6f2fc5ad376687651478273dac105051", + "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/2e7f37a69162fea02059c764a318a920121f8b4a", + "reference": "2e7f37a69162fea02059c764a318a920121f8b4a", "shasum": "" }, "require": { @@ -551,7 +551,7 @@ "joomla", "utilities" ], - "time": "2014-09-03 21:44:44" + "time": "2015-03-16 18:50:58" }, { "name": "leafo/lessphp", diff --git a/libraries/cms/html/select.php b/libraries/cms/html/select.php index 9dda2da17acd2..06f8c21a6c14b 100644 --- a/libraries/cms/html/select.php +++ b/libraries/cms/html/select.php @@ -464,8 +464,8 @@ public static function option($value, $text = '', $optKey = 'value', $optText = } $obj = new stdClass; - $obj->$options['option.key'] = $value; - $obj->$options['option.text'] = trim($text) ? $text : $value; + $obj->{$options['option.key']} = $value; + $obj->{$options['option.text']} = trim($text) ? $text : $value; /* * If a label is provided, save it. If no label is provided and there is @@ -480,19 +480,19 @@ public static function option($value, $text = '', $optKey = 'value', $optText = } elseif ($hasProperty) { - $obj->$options['option.label'] = ''; + $obj->{$options['option.label']} = ''; } // Set attributes only if there is a property and a value if ($options['attr'] !== null) { - $obj->$options['option.attr'] = $options['attr']; + $obj->{$options['option.attr']} = $options['attr']; } // Set disable only if it has a property and a value if ($options['disable'] !== null) { - $obj->$options['option.disable'] = $options['disable']; + $obj->{$options['option.disable']} = $options['disable']; } return $obj; @@ -600,37 +600,37 @@ public static function options($arr, $optKey = 'value', $optText = 'text', $sele } elseif (is_object($element)) { - $key = $options['option.key'] === null ? $elementKey : $element->$options['option.key']; - $text = $element->$options['option.text']; + $key = $options['option.key'] === null ? $elementKey : $element->{$options['option.key']}; + $text = $element->{$options['option.text']}; - if (isset($element->$options['option.attr'])) + if (isset($element->{$options['option.attr']})) { - $attr = $element->$options['option.attr']; + $attr = $element->{$options['option.attr']}; } - if (isset($element->$options['option.id'])) + if (isset($element->{$options['option.id']})) { - $id = $element->$options['option.id']; + $id = $element->{$options['option.id']}; } - if (isset($element->$options['option.label'])) + if (isset($element->{$options['option.label']})) { - $label = $element->$options['option.label']; + $label = $element->{$options['option.label']}; } - if (isset($element->$options['option.disable']) && $element->$options['option.disable']) + if (isset($element->{$options['option.disable']}) && $element->{$options['option.disable']}) { $extra .= ' disabled="disabled"'; } - if (isset($element->$options['option.class']) && $element->$options['option.class']) + if (isset($element->{$options['option.class']}) && $element->{$options['option.class']}) { - $extra .= ' class="' . $element->$options['option.class'] . '"'; + $extra .= ' class="' . $element->{$options['option.class']} . '"'; } - if (isset($element->$options['option.onclick']) && $element->$options['option.onclick']) + if (isset($element->{$options['option.onclick']}) && $element->{$options['option.onclick']}) { - $extra .= ' onclick="' . $element->$options['option.onclick'] . '"'; + $extra .= ' onclick="' . $element->{$options['option.onclick']} . '"'; } } else diff --git a/libraries/cms/menu/menu.php b/libraries/cms/menu/menu.php index 36ff71099dc1a..cda1173011682 100644 --- a/libraries/cms/menu/menu.php +++ b/libraries/cms/menu/menu.php @@ -266,7 +266,7 @@ public function getItems($attributes, $values, $firstonly = false) { if (is_array($values[$i])) { - if (!in_array($item->$attributes[$i], $values[$i])) + if (!in_array($item->{$attributes[$i]}, $values[$i])) { $test = false; break; @@ -274,7 +274,7 @@ public function getItems($attributes, $values, $firstonly = false) } else { - if ($item->$attributes[$i] != $values[$i]) + if ($item->{$attributes[$i]} != $values[$i]) { $test = false; break; diff --git a/libraries/joomla/keychain/keychain.php b/libraries/joomla/keychain/keychain.php index a591e1f98a8d4..ea86d9a7bef5e 100644 --- a/libraries/joomla/keychain/keychain.php +++ b/libraries/joomla/keychain/keychain.php @@ -84,17 +84,17 @@ public function deleteValue($path) // Traverse the registry to find the correct node for the result. for ($i = 0, $n = count($nodes) - 1; $i < $n; $i++) { - if (!isset($node->$nodes[$i]) && ($i != $n)) + if (!isset($node->{$nodes[$i]}) && ($i != $n)) { - $node->$nodes[$i] = new stdClass; + $node->{$nodes[$i]} = new stdClass; } - $node = $node->$nodes[$i]; + $node = $node->{$nodes[$i]}; } // Get the old value if exists so we can return it - $result = $node->$nodes[$i]; - unset($node->$nodes[$i]); + $result = $node->{$nodes[$i]}; + unset($node->{$nodes[$i]}); } return $result; diff --git a/libraries/joomla/utilities/arrayhelper.php b/libraries/joomla/utilities/arrayhelper.php index b26823b9ad3a7..3b73a1253792c 100644 --- a/libraries/joomla/utilities/arrayhelper.php +++ b/libraries/joomla/utilities/arrayhelper.php @@ -457,8 +457,8 @@ protected static function _sortObjects(&$a, &$b) $locale = self::$sortLocale[$i]; } - $va = $a->$key[$i]; - $vb = $b->$key[$i]; + $va = $a->{$key[$i]}; + $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { diff --git a/libraries/vendor/autoload.php b/libraries/vendor/autoload.php index f2aeba51489ec..baecd9740292a 100644 --- a/libraries/vendor/autoload.php +++ b/libraries/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit13e7038e3c9f87f9f8ac2ce0fc0b2380::getLoader(); +return ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7::getLoader(); diff --git a/libraries/vendor/composer/autoload_real.php b/libraries/vendor/composer/autoload_real.php index d89688158435b..60bdad1198a32 100644 --- a/libraries/vendor/composer/autoload_real.php +++ b/libraries/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit13e7038e3c9f87f9f8ac2ce0fc0b2380 +class ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7 { private static $loader; @@ -19,9 +19,9 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit13e7038e3c9f87f9f8ac2ce0fc0b2380', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit13e7038e3c9f87f9f8ac2ce0fc0b2380', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitf9aed076f12471aff0049364a504b3f7', 'loadClassLoader')); $map = require __DIR__ . '/autoload_namespaces.php'; foreach ($map as $namespace => $path) { @@ -42,14 +42,14 @@ public static function getLoader() $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire13e7038e3c9f87f9f8ac2ce0fc0b2380($file); + composerRequiref9aed076f12471aff0049364a504b3f7($file); } return $loader; } } -function composerRequire13e7038e3c9f87f9f8ac2ce0fc0b2380($file) +function composerRequiref9aed076f12471aff0049364a504b3f7($file) { require $file; } diff --git a/libraries/vendor/composer/installed.json b/libraries/vendor/composer/installed.json index 9ab04a9d03078..1f834aefe431c 100644 --- a/libraries/vendor/composer/installed.json +++ b/libraries/vendor/composer/installed.json @@ -245,55 +245,6 @@ "description": "lessphp is a compiler for LESS written in PHP.", "homepage": "http://leafo.net/lessphp/" }, - { - "name": "joomla/utilities", - "version": "1.2.0", - "version_normalized": "1.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/joomla-framework/utilities.git", - "reference": "f749a9bd6f2fc5ad376687651478273dac105051" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/f749a9bd6f2fc5ad376687651478273dac105051", - "reference": "f749a9bd6f2fc5ad376687651478273dac105051", - "shasum": "" - }, - "require": { - "joomla/string": "~1.0", - "php": ">=5.3.10" - }, - "require-dev": { - "phpunit/phpunit": "4.*", - "squizlabs/php_codesniffer": "1.*" - }, - "time": "2014-09-03 21:44:44", - "type": "joomla-package", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Joomla\\Utilities\\": "src/", - "Joomla\\Utilities\\Tests\\": "Tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0+" - ], - "description": "Joomla Utilities Package", - "homepage": "https://github.com/joomla-framework/utilities", - "keywords": [ - "framework", - "joomla", - "utilities" - ] - }, { "name": "joomla/input", "version": "1.2.0", @@ -652,19 +603,68 @@ "joomla" ] }, + { + "name": "joomla/string", + "version": "1.2.2", + "version_normalized": "1.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/joomla-framework/string.git", + "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/joomla-framework/string/zipball/9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", + "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", + "shasum": "" + }, + "require": { + "php": ">=5.3.10" + }, + "require-dev": { + "joomla/test": "~1.0", + "phpunit/phpunit": "4.*", + "squizlabs/php_codesniffer": "1.*" + }, + "time": "2015-03-13 12:29:00", + "type": "joomla-package", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Joomla\\String\\": "src/", + "Joomla\\String\\Tests\\": "Tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "description": "Joomla String Package", + "homepage": "https://github.com/joomla-framework/string", + "keywords": [ + "framework", + "joomla", + "string" + ] + }, { "name": "joomla/registry", - "version": "1.4.2", - "version_normalized": "1.4.2.0", + "version": "1.4.4", + "version_normalized": "1.4.4.0", "source": { "type": "git", "url": "https://github.com/joomla-framework/registry.git", - "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e" + "reference": "730467978ad52677903e973bb33be2306eb161eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/registry/zipball/5c2e607ff61f8df07c3c0630ed62a8c3d892469e", - "reference": "5c2e607ff61f8df07c3c0630ed62a8c3d892469e", + "url": "https://api.github.com/repos/joomla-framework/registry/zipball/730467978ad52677903e973bb33be2306eb161eb", + "reference": "730467978ad52677903e973bb33be2306eb161eb", "shasum": "" }, "require": { @@ -682,7 +682,7 @@ "suggest": { "symfony/yaml": "Install 2.* if you require YAML support." }, - "time": "2015-03-07 18:48:26", + "time": "2015-03-16 18:49:29", "type": "joomla-package", "extra": { "branch-alias": { @@ -709,29 +709,29 @@ ] }, { - "name": "joomla/string", - "version": "1.2.2", - "version_normalized": "1.2.2.0", + "name": "joomla/utilities", + "version": "1.3.2", + "version_normalized": "1.3.2.0", "source": { "type": "git", - "url": "https://github.com/joomla-framework/string.git", - "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692" + "url": "https://github.com/joomla-framework/utilities.git", + "reference": "2e7f37a69162fea02059c764a318a920121f8b4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/joomla-framework/string/zipball/9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", - "reference": "9f7b27d6b2d48d65b2fe81b5c6d72225629ad692", + "url": "https://api.github.com/repos/joomla-framework/utilities/zipball/2e7f37a69162fea02059c764a318a920121f8b4a", + "reference": "2e7f37a69162fea02059c764a318a920121f8b4a", "shasum": "" }, "require": { + "joomla/string": "~1.0", "php": ">=5.3.10" }, "require-dev": { - "joomla/test": "~1.0", "phpunit/phpunit": "4.*", "squizlabs/php_codesniffer": "1.*" }, - "time": "2015-03-13 12:29:00", + "time": "2015-03-16 18:50:58", "type": "joomla-package", "extra": { "branch-alias": { @@ -741,20 +741,20 @@ "installation-source": "dist", "autoload": { "psr-4": { - "Joomla\\String\\": "src/", - "Joomla\\String\\Tests\\": "Tests/" + "Joomla\\Utilities\\": "src/", + "Joomla\\Utilities\\Tests\\": "Tests/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0+" ], - "description": "Joomla String Package", - "homepage": "https://github.com/joomla-framework/string", + "description": "Joomla Utilities Package", + "homepage": "https://github.com/joomla-framework/utilities", "keywords": [ "framework", "joomla", - "string" + "utilities" ] } ] diff --git a/libraries/vendor/joomla/registry/src/Format/Xml.php b/libraries/vendor/joomla/registry/src/Format/Xml.php index 8dc59cf6bf4cc..e42b185f8e3aa 100644 --- a/libraries/vendor/joomla/registry/src/Format/Xml.php +++ b/libraries/vendor/joomla/registry/src/Format/Xml.php @@ -64,7 +64,7 @@ public function stringToObject($data, array $options = array()) foreach ($xml->children() as $node) { - $obj->$node['name'] = $this->getValueFromNode($node); + $obj->{$node['name']} = $this->getValueFromNode($node); } return $obj; @@ -120,7 +120,7 @@ protected function getValueFromNode($node) foreach ($node->children() as $child) { - $value->$child['name'] = $this->getValueFromNode($child); + $value->{$child['name']} = $this->getValueFromNode($child); } break; diff --git a/libraries/vendor/joomla/registry/src/Registry.php b/libraries/vendor/joomla/registry/src/Registry.php index 8c970b8f1d636..3f59af6974021 100644 --- a/libraries/vendor/joomla/registry/src/Registry.php +++ b/libraries/vendor/joomla/registry/src/Registry.php @@ -500,13 +500,13 @@ public function set($path, $value, $separator = null) { if (is_object($node)) { - if (!isset($node->$nodes[$i]) && ($i != $n)) + if (!isset($node->{$nodes[$i]}) && ($i != $n)) { - $node->$nodes[$i] = new \stdClass; + $node->{$nodes[$i]} = new \stdClass; } // Pass the child as pointer in case it is an object - $node = &$node->$nodes[$i]; + $node = &$node->{$nodes[$i]}; continue; } @@ -527,7 +527,7 @@ public function set($path, $value, $separator = null) switch (true) { case (is_object($node)): - $result = $node->$nodes[$i] = $value; + $result = $node->{$nodes[$i]} = $value; break; case (is_array($node)): @@ -574,13 +574,13 @@ public function append($path, $value) { if (is_object($node)) { - if (!isset($node->$nodes[$i]) && ($i != $n)) + if (!isset($node->{$nodes[$i]}) && ($i != $n)) { - $node->$nodes[$i] = new \stdClass; + $node->{$nodes[$i]} = new \stdClass; } // Pass the child as pointer in case it is an array - $node = &$node->$nodes[$i]; + $node = &$node->{$nodes[$i]}; } elseif (is_array($node)) { diff --git a/libraries/vendor/joomla/utilities/src/ArrayHelper.php b/libraries/vendor/joomla/utilities/src/ArrayHelper.php index 5493cbc8882e8..ea4e764a63911 100644 --- a/libraries/vendor/joomla/utilities/src/ArrayHelper.php +++ b/libraries/vendor/joomla/utilities/src/ArrayHelper.php @@ -2,7 +2,7 @@ /** * Part of the Joomla Framework Utilities Package * - * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. + * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ @@ -230,17 +230,24 @@ public static function getColumn(array $array, $index) /** * Utility function to return a value from a named array or a specified default * - * @param array $array A named array - * @param string $name The key to search for - * @param mixed $default The default value to give if no key found - * @param string $type Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) + * @param array|\ArrayAccess $array A named array or object that implements ArrayAccess + * @param string $name The key to search for + * @param mixed $default The default value to give if no key found + * @param string $type Return type for the variable (INT, FLOAT, STRING, WORD, BOOLEAN, ARRAY) * * @return mixed The value from the source array * + * @throws InvalidArgumentException + * * @since 1.0 */ - public static function getValue(array $array, $name, $default = null, $type = '') + public static function getValue($array, $name, $default = null, $type = '') { + if (!is_array($array) && !($array instanceof \ArrayAccess)) + { + throw new \InvalidArgumentException('The object must be an array or a object that implements ArrayAccess'); + } + $result = null; if (isset($array[$name])) @@ -496,8 +503,8 @@ public static function sortObjects(array $a, $k, $direction = 1, $caseSensitive $locale = $sortLocale[$i]; } - $va = $a->$key[$i]; - $vb = $b->$key[$i]; + $va = $a->{$key[$i]}; + $vb = $b->{$key[$i]}; if ((is_bool($va) || is_numeric($va)) && (is_bool($vb) || is_numeric($vb))) { @@ -575,4 +582,43 @@ public static function arraySearch($needle, array $haystack, $caseSensitive = tr return false; } + + /** + * Method to recursively convert data to a one dimension array. + * + * @param array|object $array The array or object to convert. + * @param string $separator The key separator. + * @param string $prefix Last level key prefix. + * + * @return array + * + * @since 1.3.0 + */ + public static function flatten($array, $separator = '.', $prefix = '') + { + if ($array instanceof \Traversable) + { + $array = iterator_to_array($array); + } + elseif (is_object($array)) + { + $array = get_object_vars($array); + } + + foreach ($array as $k => $v) + { + $key = $prefix ? $prefix . $separator . $k : $k; + + if (is_object($v) || is_array($v)) + { + $array = array_merge($array, static::flatten($v, $separator, $key)); + } + else + { + $array[$key] = $v; + } + } + + return $array; + } }