Ejemplo n.º 1
0
 /**
  * Displays available commands or the detailed information to the current command.
  * 
  * @throws Exception the exception throwed for unknown command or bad controller
  */
 public function help()
 {
     $result = P::$app->createController('help');
     /* @var $controller \yii\console\controllers\HelpController */
     $controller = $result !== false ? $result[0] : null;
     if ($controller !== null || !$controller instanceof Controller) {
         throw new Exception(P::t('platform', 'No help for this command.', ['command' => $this->owner->ansiFormat('help', Console::FG_YELLOW)]));
     }
     $controller->actionIndex($this->owner->id);
 }
Ejemplo n.º 2
0
 public function getValue()
 {
     if (!empty($_SERVER['argv'])) {
         $option = '--' . Application::OPTION_APPHOST . '=';
         foreach ($_SERVER['argv'] as $param) {
             if (strpos($param, $option) !== false) {
                 $host = substr($param, strlen($option));
                 return $host;
             }
         }
     }
     $this->stdout(P::t('platform', 'Missing required option: --{name}', ['name' => Application::OPTION_APPHOST]), Console::FG_RED);
     die("\n\n");
 }