public static function getInitialRoute()
 {
     $route = null;
     $input = new TerminalInput();
     $input->importFromGlobals();
     $input = StructUtils::toArray($input);
     $route = StructUtils::get($input, '--module');
     return $route;
 }
Пример #2
0
 /**
  * @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;
 }
Пример #3
0
 public function getAsArray($aPath)
 {
     $value = StructUtils::get($this->data, $aPath);
     return is_array($value) ? $value : [];
 }
Пример #4
0
 public function get($aPath)
 {
     return StructUtils::get($this->data, $aPath);
 }