public static function getInitialRoute() { $route = null; $input = new TerminalInput(); $input->importFromGlobals(); $input = StructUtils::toArray($input); $route = StructUtils::get($input, '--module'); return $route; }
/** * @param array $aArray Source array. * @param string $aPath Path of the item to check. * @param mixed $aValue Value to compare to. * @param string $aSeparator Separator used by path. * @return bool|int|string Integer or string key if a match was found, boolean false if not. */ public static function search($aArray, $aPath, $aValue, $aSeparator = '.') { foreach ($aArray as $k => $v) { if (StructUtils::get($v, $aPath, $aSeparator) == $aValue) { return $k; } } return false; }
public function getAsArray($aPath) { $value = StructUtils::get($this->data, $aPath); return is_array($value) ? $value : []; }
public function get($aPath) { return StructUtils::get($this->data, $aPath); }