Ejemplo n.º 1
0
 function __construct($arguments = array(), $options = array())
 {
     array_shift($arguments);
     foreach ($arguments as $k => $v) {
         if (strpos($v, "=") > -1 || strpos($v, "--") > -1) {
             $v = str_replace("--", "", $v);
             $split = explode("=", $v);
             $options[$split[0]] = trim($split[1]);
             for ($i = $k + 1; $i <= count($arguments); $i++) {
                 if (strpos($arguments[$i], "--") > -1) {
                     break;
                 }
                 $options[$split[0]] .= " " . trim($arguments[$i]);
             }
         }
         if ($k < 2) {
             unset($arguments[$k]);
             switch ($k) {
                 case 0:
                     $k = "module";
                     break;
                 case 1:
                     $k = "action";
                     break;
             }
             $arguments[$k] = trim($v);
         }
     }
     MojoConfig::bootstrap($arguments);
     self::handler($arguments, $options);
 }