Initialize main command

@param string $param

@return void
431423
private function initCommand($param)
    {
        if (!preg_match('/^[a-z]+:[a-z]+$/', $param)) {
            $this->options['command'] = $param;

            return;
        }
        
        $part = explode(':', $param);

        $this->options['command'] = $part[0];

        $this->options['action'] = $part[1];
    }
588923
public function addParam(Parameter $param)
    {
        $this->parameters[$param->getName()] = $param;
        $param->setParent($this);

        return $this;
    }
768998
private function initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            for ($i = 0, $_i = count($params); $i < $_i; $i++) {
                if (self::LINES_KEY == $params[$i]->getName()) {
                    $this->lines = (int) $params[$i]->getValue();
                    continue;
                }
                if (self::SKIP_KEY == $params[$i]->getName()) {
                    $this->skip = (int) $params[$i]->getValue();
                    continue;
                }
            }
        }
    }
69515
public void init(
        boolean             forEncryption,
        CipherParameters    param)
    {
        if (core == null)
        {
            core = new NativeRSACoreEngine();
        }

        core.init(forEncryption, param);
    }
472116
protected function initialiseCommands()
    {
        $modules = $this->kernel->getModules();

        foreach ($modules as $module) {
            if ( ! $module instanceof ConsoleModuleInterface) {
                continue;
            }

            $module->registerCommands($this);
        }
    }
1043870
protected function runConsole(array $params): void
    {
        $kernel = $this->app->make(KernelContract::class);

        $status = $kernel->handle(
            $input = new ArgvInput(array_values($params)),
            new ConsoleOutput()
        );

        $kernel->terminate($input, $status);

        exit($status);
    }
225916
public function init()
    {
        if (Console::isCli()) {
            // fix for fcgi
            defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

            if (!isset($_SERVER['argv'])) {
                die('This script must be run from the command line.');
            }
            $this->_runner = $this->createCommandRunner();
            $this->_runner->commands = $this->commandMap;
            $this->_runner->addCommands($this->getCommandPath());

            $env = @getenv('CONSOLE_COMMANDS');
            if (!empty($env)) {
                $this->_runner->addCommands($env);
            }

            foreach ($this->modules as $name => $settings) {
                $modulePath = Alias::get("Modules." . $name . ".Commands");
                if ($modulePath) {
                    $this->_runner->addCommands($modulePath);
                }
            }
        } else {
            // preload 'request' so that it has chance to respond to onBeginRequest event.
            $this->getComponent('request');
        }
    }
865054
public function actionParse($param)
    {
        $model = new ParseForm();
        $model->kadastr = $param;
        $data = $model->parse();

        echo $this->render('parse',['data'=>$data]);
    }
762891
public function list_commands($param = []){
    //Prepping, processing and validating the create user parameters
    $param = $this->process_parameters($param);
    //Setting the last action performed
    $this->last_action = "list-commands";

    //Defining  the $url_part and the command to be executed
    $url_part = "list-commands";
    if (isset($param['short'])){//short parameter is set
      $url_part .= "&short";
    }

    if (isset($param['nameonly'])){//nameonly parameter is set
      $url_part .= "&nameonly";
    }
    //Concatenating the closing single quote
    $url_part .="'";
    //Concatenating the header url and $url_part to create the full url to be executed
    $url_part = $this->get_header_url() . $url_part;

    //test
    $uid = $this->hostname;
    if ( !empty($param) ){
      $uid .= md5(json_encode($param));
    }

    if ( $this->cache_has($uid, 'list_commands') ){
      $result_call = $this->cache_get($uid, 'list_commands');
    }
    else {
      $result_call = $this->call_shell_exec($url_part);
      $this->cache_set($uid, 'list_commands', $result_call);
    }
    return $result_call;
  }
292609
private function _initialize()
    {
        $params = $this->getParameters();
        if ($params !== null) {
            foreach ($params as $param) {
                switch ($param->getType()) {
                    case self::DOMAIN_KEY:
                        $this->setDomain($param->getValue());
                        break;
                    case self::DIR_KEY:
                        $this->setDir($this->project->resolveFile($param->getValue()));
                        break;

                    case self::LOCALE_KEY:
                        $this->setLocale($param->getValue());
                        break;
                } // switch
            }
        } // if params !== null
    }
223499
public function main() {
    $command = array();

    $command[] = !empty($this->bin) ? $this->bin : 'drush';

    if (!empty($this->alias)) {
      $command[] = $this->alias;
    }

    if (empty($this->color)) {
      $option = new Option();
      $option->setName('nocolor');
      $this->options[] = $option;
    }


    if (!empty($this->root)) {
      $option = new Option();
      $option->setName('root');
      $option->addText($this->root);
      $this->options[] = $option;
    }

    if (!empty($this->uri)) {
      $option = new Option();
      $option->setName('uri');
      $option->addText($this->uri);
      $this->options[] = $option;
    }

    if (!empty($this->config)) {
      $option = new Option();
      $option->setName('config');
      $option->addText($this->config);
      $this->options[] = $option;
    }

    if (!empty($this->aliasPath)) {
      $option = new Option();
      $option->setName('alias-path');
      $option->addText($this->uri);
      $this->options[] = $option;
    }

    if (is_bool($this->assume)) {
      $option = new Option();
      $option->setName(($this->assume ? 'yes' : 'no'));
      $this->options[] = $option;
    }

    if ($this->simulate) {
      $option = new Option();
      $option->setName('simulate');
      $this->options[] = $option;
    }

    if ($this->pipe) {
      $option = new Option();
      $option->setName('pipe');
      $this->options[] = $option;
    }

    if ($this->verbose) {
      $option = new Option();
      $option->setName('verbose');
      $this->options[] = $option;
    }

    foreach ($this->options as $option) {
      $command[] = $option->toString();
    }

    $command[] = $this->command;

    foreach ($this->params as $param) {
      $command[] = '"' . escapeshellcmd($param->getValue()) . '"';
    }

    $command = implode(' ', $command);

    if ($this->dir !== NULL) {
      $currdir = getcwd();
      @chdir($this->dir->getPath());
    }

    // Execute Drush.
    $this->log("Executing '$command'...");
    $output = array();
    exec($command, $output, $return);

    if (isset($currdir)) {
      @chdir($currdir);
    }

    // Collect Drush output for display through Phing's log.
    foreach ($output as $line) {
      $this->log($line);
    }
    // Set value of the 'pipe' property.
    if (!empty($this->returnProperty)) {
      $this->getProject()->setProperty($this->returnProperty, implode($this->returnGlue, $output));
    }
    // Build fail.
    if ($this->haltOnError && $return != 0) {
      throw new \BuildException("Drush exited with code $return");
    }
    return $return != 0;
  }
427841
protected function parseParam($param)
    {
        $method = 'parse'.ucfirst($param);

        if (method_exists($this, $method)) {
            if ($params = $this->input($param)) {
                return $this->$method($params);
            }
        }
    }
611553
private function setUp($param)
    {
        if (!isset($param['id'])) {
            $this->sendError();
        }

        $this->articleId = 0 + $param['id'];
        $this->articlePatch = $this->articlePatch.$this->articleId.'/';
    }
1187428
public function startCommand(): void
    {
        $daemon = $this->getSameOpt(['d', 'daemon']);

        $this->createServer()->asDaemon($daemon)->start();
    }
1270783
def _init_command_data(params)
      # set state
      @state = {
        result: true,
        errors: []
      }

      # set options
      initial_options = {
        exceptions: false,
        nullify_empty_params: false
      }
      default_options = _safe_default_options || {}
      params_options = params[:_options] || {}
      @options = initial_options.merge(default_options)
                                .merge(params_options)

      # set other data
      @params = params
    end
46126
public function list_commands($param = []){
    //Prepping, processing and validating the create user parameters
    $param = $this->process_parameters($param);
    //Setting the last action performed
    $this->last_action = "list-commands";

    //Defining  the $url_part and the command to be executed
    $url_part = "list-commands";
    if (isset($param['short'])){//short parameter is set
      $url_part .= "&short";
    }

    if (isset($param['nameonly'])){//nameonly parameter is set
      $url_part .= "&nameonly";
    }
    //Concatenating the closing single quote
    $url_part .="'";
    //Concatenating the header url and $url_part to create the full url to be executed
    $url_part = $this->get_header_url() . $url_part;
    //Calling shell_exec and returning the result array
    return $this->call_shell_exec($url_part);
  }
537410
protected function init()
    {
        $this->addCommand(new SyncCommand());
        $this->addCommand(new MakesumCommand());

        $this->addGlobalOption('e')
            ->alias('env')
            ->description('The environment application name or class.')
            ->defaultValue('dev');
    }