コマンドの実行

@param Array $params  引数パラメータ
@return void
493788
public function execute (Array $params)
    {
        try {
            // パラメータバリデート
            $this->_validateParameters($params);

            // スケルトンをコピーする
            $cmd = GARNET.DS.'Command';
            $params[0] = ucfirst($params[0]);
            $file_name = $params[0].'.php';
            $file_path = $cmd.DS.$file_name;

            // クエリ
            $data = file_get_contents(ROOT.DS.$cmd.DS.'Skeleton'.DS.'CommandSkeleton.php');
            $data = str_replace('${command}', $params[0], $data);
            file_put_contents($cmd.DS.$params[0].'.php', $data);

            $this->log($params[0].'コマンドを作成しました！', 'success');
        
        } catch (\Exception $e) {
            $this->errorLog($e->getMessage());
        }
    }
1309622
public function execute (Array $params)
    {
        try {
            $this->_validateParameters($params);
            
            // スケルトンファイルを取得する
            $skeleton = $this->_getSkeletonFile();

            // スケルトンファイルのコンテンツを置換
            $skeleton = str_replace('${command}', $this->command_name, $skeleton);
            file_put_contents(LIB.'/'.APP.'/Commands/'.$this->command_name.'.php', $skeleton);

            $this->log($this->command_name.' command is created!', 'success');
        
        } catch (\Exception $e) {
            $this->errorLog($e->getMessage());
        }
    }
919071
public function launch(array $inputs = array()) {
    $params = array('id' => $this->id);
    if(count($inputs) > 0) {
      $params['inputs'] = $inputs;
    }
    $this->executeCommand($this->_path_for_regex . '_launch', $params);
  }
686562
public static function run($query, $params=array()) {
		
		$self = static::getInstance();
		
		$self->openConnection();
		
		$ret = NULL;
		
		try {
			
			// prepare query
			$stat = $self->handler->prepare($query);

			// bind parameters
			$stat->execute((array)$params);

			// count affected rows
			$affected = $stat->rowCount();
			
		} catch (\PDOException $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			
			switch ($e->getCode()) {
				
				// integrity constraint violation
				/*
				 case '23000':
					 $message = 'Database integrity constraint violation';
					 break;
				 */
				default:
					$message = $e->getMessage();
					break;
			}
			
			$self->addError($message);
			
			$affected = 0;
			
		} catch (\Exception $e) {
			
			// logger
			$self->logParamQuery($query, 0, $params);
			$self->addError($e->getMessage());
			$affected = 0;
			
		}
		
		$stat->closeCursor();
		$self->logParamQuery($query, $affected, $params);
		
		return $affected;
			
	}
140039
public static function run($hook, array $params = array())
    {
        // Make sure the hook index exists
        if (!isset(static::$plugins[$hook])) {
            return false;
        }

        // Run the hook
        foreach (static::$plugins[$hook] as $plugin) {
            call_user_func_array($plugin, $params);
        }
    }
988833
private function _action($params)
    {
        // Shift and get the method
        $method = array_shift($params);

        // Behavior
        if ($this->behaviors[$method]) {
            $this->behaviors[$method]();
        }

        if (!isset($this->routes[$method])) {
            $this->_defaultAction();
        }

        // Get corresponding method name
        $method = $this->routes[$method];

        if (!method_exists($this, $method)) {
            $this->_defaultAction();
        }

        return call_user_func_array([$this, $method], $params);
    }
952215
public function action_create( $params )
	{
		$name = array_shift( $params );
		
		$file = \DB\Migrator::path( $name );
		
		\CCFile::write( $file, "# ---> up\n\n\n\n# ---> down\n\n" );
	}
1215613
private function _validateParameters ($params)
    {
        // 引数の有無
        if (! isset($params[0])) {
            throw new \Exception('生成するコマンド名を指定してください');
        }

        // 既に存在するかどうか
        $params[0] = ucfirst($params[0]);
        if (file_exists(GARNET.DS.'Command'.DS.$params[0].'.php')) {
            throw new \Exception($params[0].' コマンドは既に存在しています');
        }
    }
168723
public function delete($params)
    {
        $query = $this->query->delete($params);
        $this->db->exec($this->query->useQuery($params['db_name']));
        $prepare = $this->db->prepare($query);
        if ($prepare->execute()) {
            $prepare->closeCursor();

            return true;
        }
    }
334486
public function query($query, $params = []) {
		$statement = $this->get_statement($query, $params);
		$statement->execute();
	}
490016
protected function _render($params) {
		foreach ($params as $name => $param) {
			if ($name === 'run' || empty($param['name'])) {
				continue;
			}
			$usage = (!empty($param['usage'])) ? trim($param['usage'], ' []') : $param['name'];
			$this->out($this->_pad($usage), 'option');

			if ($param['description']) {
				$this->out($this->_pad($param['description'], 2));
			}
			$this->nl();
		}
	}
493055
public function createOrder(Array $params)
    {
        $createOrderRequest = $this->getRequestParam('CreateOrderRequestParam', $params, $this->config, $this->sign);

        $formContent = $this->executeFormRequest($createOrderRequest);

        echo $formContent;
    }
894960
public function setQueryParams(array $params)
    {
        $uri = $this->guzzleRequest->getUri()->withQuery(\GuzzleHttp\Psr7\build_query($params));
        $this->guzzleRequest = $this->guzzleRequest->withUri($uri);
    }
913116
protected function setParams(array $params) {
		parent::setParams($params);
		if($this->autoinc===true){
			$this->notNull=false;
		}
	}
1244948
public static function run(array $params = [], ?string $basePath = null): void
    {
        $instance = static::instance();

        $instance->bootstrap($basePath);

        $instance->runConsole($params);
    }
776581
public function runWithParams($params)
    {
        $args = $this->controller->bindActionParams($this, $params);
        Log::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()' . __METHOD__);
        if (Zilf::$app->requestedParams === null) {
            Zilf::$app->requestedParams = $args;
        }

        return call_user_func_array([$this->controller, $this->actionMethod], $args);
    }
1007470
public function handle(...$params): void
    {
        /* @var Server $server */
        $server = array_shift($params);
        /* @var int $fd */
        $fd = array_shift($params);
        /* @var Container $app */
        $app = $server->getApplication();

        $packData = $app->make('websocket.parser')->pack(
            $app->make('websocket.data_converter')->conversion($params)
        );

        if ($server->getServer()->isEstablished($fd)) {
            $server->getServer()->push($fd, $packData);

            return;
        }

        throw new OutOfBoundsException("The fd:[{$fd}] not websocket or websocket close");
    }