public static function message($file, $path = NULL, $default = NULL) { static $messages; if (!isset($messages[$file])) { $messages[$file] = array(); if ($files = self::load_messages($file)) { $messages[$file] = Wparr::merge($messages[$file], $files); } } if ($path === NULL) { return $messages[$file]; } else { return Wparr::path($messages[$file], $path, $default); } }
public static function extract($array, array $paths, $default = NULL) { $found = array(); foreach ($paths as $path) { Wparr::set_path($found, $path, Wparr::path($array, $path, $default)); } return $found; }