diff --git a/src/mibew/libs/common/misc.php b/src/mibew/libs/common/misc.php index 4b36b71f..89747c91 100644 --- a/src/mibew/libs/common/misc.php +++ b/src/mibew/libs/common/misc.php @@ -15,14 +15,6 @@ * limitations under the License. */ -function debugexit_print($var) -{ - echo "
";
-    print_r($var);
-    echo "
"; - exit; -} - function get_gifimage_size($filename) { if (function_exists('gd_info')) { @@ -42,70 +34,11 @@ function get_gifimage_size($filename) return array(0, 0); } -function js_path() -{ - return "js/compiled"; -} - function div($a, $b) { return ($a - ($a % $b)) / $b; } -/** - * Flatten array recursively. - * - * For example if input array is: - * - * $input = array( - * 'first' => 1, - * 'second' => array( - * 'f' => 'value', - * 's' => null, - * 't' => array( - * 'one', 'two', 'three' - * ), - * 'f' => 4 - * ), - * 'third' => false, - * ); - * - * the output array will be: - * - * $output = array( - * 'first' => 1, - * 'second.f' => 'value', - * 'second.s' => null, - * 'second.t.0' => 'one', - * 'second.t.1' => 'two', - * 'second.t.2' => 'three' - * 'second.f' => 4, - * 'third' => false - * ); - * - * - * @param array $arr Array to flatten - * @return array - */ -function array_flatten_recursive($arr) -{ - $result = array(); - foreach ($arr as $key => $value) { - if (is_array($value)) { - // Flatten nested arrays - $value = array_flatten_recursive($value); - foreach ($value as $inner_key => $inner_value) { - $result[$key . "." . $inner_key] = $inner_value; - } - } else { - // Leave scalar values 'as is' - $result[$key] = $value; - } - } - - return $result; -} - /** * Checks if currently processed script is installation script. *