Runs the command.

@return mixed
321061
public function run()
    {
        if ($this->help) {

            return $this->showHelp();
        }
        if ($this->confFile) {
            $fakerino = Fakerino::create($this->confFile);
        } else {
            $fakerino = Fakerino::create();
            if ($this->locale) {
                $conf = array();
                $conf['locale'] = $this->locale;
                $fakerino = Fakerino::create($conf);
            }
        }
        if (!$this->num) {
            $this->num = 1;
        }
        if ($this->table) {
            $fakerino->num($this->num)->fakeTable($this->table);

            return;
        }
        if ($this->templateSource) {
            return $fakerino->num($this->num)->fakeTemplate($this->templateSource) . PHP_EOL;
        }
        $fakerino = $fakerino->fake($this->input)->num($this->num);

        if ($this->json) {
            $result = $fakerino->toJson();
        } else {
            $result = (string)$fakerino;
        }

        return $result . PHP_EOL;
    }
881481
public function run()
    {
        $output = PHP_EOL.$this->key().Colors::BG_BLACK.Colors::WHITE;
        return $output;
    }
1151544
public function run() {
        $response = $this->getResponse();
        $this->invoke($this->getEvent(), [$this, $response]);
        return $response;
    }
974606
public function run()
    {
        if(\count($this->option) === 0) {
            return $this->help();
        }
        else {
            return $this->executeHelp($this->option[0]);
        }
    }
130538
public final function run()
    {
        $this->registerServices();
        $this->registerCommands();
        return $this->symfonyApplication->run($this->input, $this->output);
    }
588586
public function run()
    {
        /* @var $model yii\db\ActiveRecord */
        $model = new $this->modelClass;
        $model->setScenario( $this->scenario );
        if (yii::$app->getRequest()->getIsPost()) {
            if ($model->load(yii::$app->getRequest()->post()) && $model->save()) {
                yii::$app->getSession()->setFlash('success', yii::t('cms', 'Success'));
                return $this->controller->redirect(['index']);
            } else {
                $errors = $model->getErrors();
                $err = '';
                foreach ($errors as $v) {
                    $err .= $v[0] . '<br>';
                }
                Yii::$app->getSession()->setFlash('error', $err);
            }
        }
        $model->loadDefaultValues();
        $data = array_merge(['model' => $model], $this->data);
        return $this->controller->render('create', $data);
    }
328176
public function run()
    {
        try {
            return $this
                ->preRun()
                ->check();
        } catch (Exception $e) {
            return $this
                ->setMessage($e->getMessage())
                ->setCode($e->getCode());
        }
    }
1055203
public function run()
    {
        $tag = ArrayHelper::remove($this->options, 'tag', 'div');
        $html[] = Html::beginTag($tag, $this->options);

        if ($this->imageOptions) {
            $src = ArrayHelper::remove($this->imageOptions, 'src', '');
            $html[] = Html::img($src, $this->imageOptions);
        }

        $html[] = $this->encodeContent ? Html::encode($this->content) : $this->content;

        if ($this->renderIcon) {
            Html::addCssClass($this->icon['options'], ['close-trigger' => 'close']);

            $html[] = Icon::widget([
                'name' => ArrayHelper::getValue($this->icon, 'name', null),
                'position' => ArrayHelper::getValue($this->icon, 'position', ''),
                'options' => ArrayHelper::getValue($this->icon, 'options', [])
            ]);
        }

        $html[] = Html::endTag($tag);
        return implode("\n", $html);
    }
262856
public function run()
    {
        if (!isset($_SERVER['argv'][1])) {
            $_SERVER['argv'][1] = 'commands';
        }

        $input = $_SERVER['argv'][1];

        // Force `commands` command
        if (in_array(strtolower(trim($input)), ['-h', '--help', 'help'], true)) {
            $input = $_SERVER['argv'][1] = 'commands';
        }

        if (in_array(strtolower(trim($input)), ['--version', '-v', '--info'], true)) {
            $input = $_SERVER['argv'][1] = 'info';
        }

        // Try to dispatch the command
        foreach ($this->_commands as $command) {
            if ($command->hasIdentifier($input)) {
                return $this->dispatch($command);
            }
        }

        // Check for alternatives
        $available = [];
        foreach ($this->_commands as $command) {
            $providedCommands = $command->getCommands();
            foreach ($providedCommands as $alias) {
                $soundex = soundex($alias);
                if (!isset($available[$soundex])) {
                    $available[$soundex] = [];
                }

                $available[$soundex][] = $alias;
            }
        }

        // Show exception with/without alternatives
        $soundex = soundex($input);
        $message = sprintf('%s is not a recognized command.', $input);

        if (isset($available[$soundex])) {
            throw new ScriptException(sprintf('%s Did you mean: %s?', $message, join(' or ', $available[$soundex])));
        }

        throw new ScriptException($message);
    }
1173487
protected function runCommands()
    {
        // Load Remote directory
        $remote    = $this->argument('remote');
        $directory = Config::get('remote.connections.'.$remote.'.root');

        // Define commands
        $commands = array_merge(['cd '.$directory], Config::get('vdeploy::config.commands'));
        $commands = array_filter($commands);

        // Parse tags in command
        if (!$this->parseTags($commands)) {
            return false;
        }

        // Run Commands
        SSH::into($remote)->run($commands);

        return true;
    }
803819
public function run()
    {
        $route = $this->getRoute();
        $method = $this->getActionMethod(isset($route->action) ? $route->action : 'default');

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

        $this->before();
        
        if (!$this->isCancelled()) {
            $args = isset($route->args) ? $route->args
                : $this->getFunctionArgs($route, new \ReflectionMethod($this, $method)); 

            call_user_func_array([$this, $method], $args);
        }
        
        $this->after();
    }
737978
public function run()
    {
        $process = $this->getProcessExecutor();
        $process->setCommandLine($this->getCommand());

        $logger = function ($error, $line) {
            call_user_func_array(array($this, 'logLine'), array($error, $line));
        };

        return $process->run($logger);
    }
543241
function run()
    {
        if (strpos($this->cmd, ':') !== false) {
            $tmp = explode(':', $this->cmd);
            $this->cmd = $tmp[0];
            $this->subCmd = $tmp[1];
        } else {
            $this->subCmd = false;
        }

            //Select
        switch ($this->cmd) {
            case 'css':
                $this->cmdCss();
                break;

            case 'js':
                $this->cmdJs();
                break;
            
            case 'all':
                $this->cmdAll();
                break;

            case 'jss':
                $this->cmdJss();
                break;

            default:
                echo "\n\n  Command \"optimize:".$this->cmd."\" not exists!";
                exit(Main::help());
            break;
        }
            return;
    }
716604
public function run()
    {
        foreach ($this->routes as $path => $action) {
            if ($this->uri == $path) {
                return $this->executeAction($action);
            }
        }

        return $this->executeError404();
    }
64193
public function run() {

        foreach ( $this->requests as $request ) {

            if ( isset($request['ERROR_CODE']) && isset($request['ERROR_MESSAGE']) ) {

                $this->logger->warning("Invalid request ".$request['ID']);

                $result = self::packJsonError($request['ERROR_CODE'], $request['ERROR_MESSAGE'], $request['ID']);

                if ( !is_null($result) ) $this->results[] = $result;

            } else {

                try {

                    $this->logger->debug("Serving request ".$request['METHOD']."(".$request['ID'].")");

                    $response = $this->runSingleRequest($request['METHOD'], $request['PARAMETERS']);

                    $result = self::packJsonSuccess($response, $request['ID']);

                } catch (RpcException $re) {

                    $this->logger->warning("Error handling request ".$request['ID'].": ".$re->getMessage());

                    $result = self::packJsonError($re->getCode(), $re->getMessage(), $request['ID']);

                } catch (Exception $e) {

                    $this->logger->error($e->getMessage());

                    throw $e;

                }

                if ( !is_null($result) ) $this->results[] = $result;

            }


        }

        if ( empty($this->results) ) {

            return null;

        } else if ( $this->is_batch_request ) {

            return $this->results;

        } else {

            return $this->results[0];

        }

    }
467165
public function run()
    {
        parent::run();

        while (\count($this->running) || \count($this->pending)) {
            foreach ($this->running as $key => $test) {
                try {
                    if (!$this->testIsStillRunning($test)) {
                        unset($this->running[$key]);
                        $this->releaseToken($key);
                    }
                } catch (\Exception $e) {
                    if ($this->options->verbose) {
                        echo "An error for $key: {$e->getMessage()}" . PHP_EOL;
                        echo "Command: {$test->getLastCommand()}" . PHP_EOL;
                        echo 'StdErr: ' . $test->getStderr() . PHP_EOL;
                        echo 'StdOut: ' . $test->getStdout() . PHP_EOL;
                    }
                    throw $e;
                }
            }
            $this->fillRunQueue();
            usleep(10000);
        }
        $this->complete();
    }
636780
public static function run()
    {
        if ($_SERVER['argc'] < 2) {
            self::helpAction();
            exit();
        }
        $method = $_SERVER['argv'][1] . 'Action';
        if (method_exists(static::getCurrentClass(), $method)) {
            $params = $_SERVER['argv'];
            array_shift($params);
            array_shift($params);
            call_user_func_array(array(static::getCurrentClass(), $method), $params);
        } else {
            self::displayError("command unknown", true);
        }
    }