Run the command.

@return ProcessRun
175821
public function run() {
		$start_time = microtime( true );

		$proc = Utils\proc_open_compat( $this->command, self::$descriptors, $pipes, $this->cwd, $this->env );

		$stdout = stream_get_contents( $pipes[1] );
		fclose( $pipes[1] );

		$stderr = stream_get_contents( $pipes[2] );
		fclose( $pipes[2] );

		$return_code = proc_close( $proc );

		$run_time = microtime( true ) - $start_time;

		if ( self::$log_run_times ) {
			if ( ! isset( self::$run_times[ $this->command ] ) ) {
				self::$run_times[ $this->command ] = array( 0, 0 );
			}
			self::$run_times[ $this->command ][0] += $run_time;
			self::$run_times[ $this->command ][1]++;
		}

		return new ProcessRun(
			array(
				'stdout'      => $stdout,
				'stderr'      => $stderr,
				'return_code' => $return_code,
				'command'     => $this->command,
				'cwd'         => $this->cwd,
				'env'         => $this->env,
				'run_time'    => $run_time,
			)
		);
	}
533361
public function run() {
        $results = [
            $this->simulateDelete(),
            $this->simulateUpdate(),
            $this->simulateCreate()
        ];
        
        return array_search(false, $results, true) === false;
    }
958662
public function run()
    {
        try
        {
            $this['triggers']->callTrigger('before-match-request', $this);

            $this['request']->attributes->add(
                $this['router']->matchRequest($this['request'])
            );

            $this['triggers']->callTrigger('before-controller-resolver', $this);

            $this['response'] = $this->controllerResolver();
        }
        catch (ResourceNotFoundException $e)
        {
            $this['response'] = (new Controller($this))->serve404();
        }
        catch (\Exception $e)
        {
            $this['response'] = new Response();
            $this['response']->headers->set('Content-Type', 'text/plain');
            $this['response']->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
            $this['response']->setContent($e->getMessage());
        }

        if ($this['x-frame-options']) {
            $this['response']->headers->set('x-frame-options', $this['x-frame-options']);
        }

        $this['response']->prepare($this['request']);

        $this['triggers']->callTrigger('before-send-response', $this);

        $this['response']->send();
    }
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;
    }
1373052
private function runCustomProcess()
    {
        if ($this->isCustomProcessSet()) {
            $this->getCustomProcess()->run();
        } elseif (class_exists('\extensions\core\Process')) {
            \extensions\core\Process::getInstance()->run();
        }
    }
196321
public function run()
    {
        $request = $this->container->get(self::REQUEST);

        $response = $this->handle($request);

        return $this->emit($response)->stream();
    }
1251276
protected function run($cmd)
    {
        $path = getenv('PATH');

        if ($this->prependPath) {
            $path = $this->prependPath . PATH_SEPARATOR . $path;
        }

        $process = new Process($cmd, $this->currentDir(), array(
            'PATH' => $path,
        ));

        $process->run();

        $this->process = $process;

        return $process;
    }
535030
public function run() {
        $command = str_replace('.', '_', $this->_args[0]);
        $params = array_slice($this->_args, 1);
        foreach (Mage::helper('turpentine/varnish')->getSockets() as $socket) {
            $response = call_user_func_array(array($socket, $command), $params);
            $this->_write("=== Result from server [%s]: %d ===\n%s\n",
                $socket->getConnectionString(), $response['code'],
                $response['text']);
        }
    }
1363572
public function run()
    {
        pcntl_signal(SIGINT, array($this, 'stop'));
        pcntl_signal(SIGTERM, array($this, 'stop'));

        $this->running = true;
        while ($this->running) {
            $this->process();
        }
    }
237434
public function run()
    {
        if ($this->app->getName()) {
            $this->output->writeln($this->app->getName());
            $this->output->newline();
        }

        $commandName = $this->parameter->getArgument('command_name');

        if ($this->parameter->getCommandName() === $this->name && $commandName) {
            $this->showCommandHelp($this->parameter->getArgument('command_name'));
        } else {
            $this->showGeneralHelp();
        }

        return $this;
    }
897057
protected function run()
    {
        $this->lambdaCache = new CappedStorageHits;
        $this->lambdaCache->setMaxCacheSize(Daemon::$config->lambdacachemaxsize->value);
        $this->lambdaCache->setCapWindow(Daemon::$config->lambdacachecapwindow->value);

        if (Daemon::$process instanceof Master) {
            Daemon::$process->unregisterSignals();
        }

        EventLoop::init();

        Daemon::$process = $this;
        if (Daemon::$logpointerAsync) {
            Daemon::$logpointerAsync->fd = null;
            Daemon::$logpointerAsync = null;
        }
        class_exists('Timer');
        $this->autoReloadLast = time();
        $this->reloadDelay = Daemon::$config->mpmdelay->value + 2;
        $this->setState(Daemon::WSTATE_PREINIT);

        if (Daemon::$config->autogc->value > 0) {
            gc_enable();
            gc_collect_cycles();
        } else {
            gc_disable();
        }

        if (Daemon::$runworkerMode) {
            if (!Daemon::$config->verbosetty->value) {
                fclose(STDIN);
                fclose(STDOUT);
                fclose(STDERR);
            }

            Daemon::$appResolver->preload(true);
        }

        $this->prepareSystemEnv();
        $this->overrideNativeFuncs();

        $this->setState(Daemon::WSTATE_INIT);
        $this->registerEventSignals();

        FileSystem::init();
        FileSystem::initEvent();
        Daemon::openLogs();

        $this->IPCManager = Daemon::$appResolver->getInstanceByAppName('\PHPDaemon\IPCManager\IPCManager');
        if (!$this->IPCManager) {
            $this->log('cannot instantiate IPCManager');
        }

        Daemon::$appResolver->preload();

        foreach (Daemon::$appInstances as $app) {
            foreach ($app as $appInstance) {
                if (!$appInstance->ready) {
                    $appInstance->ready = true;
                    $appInstance->onReady();
                }
            }
        }

        $this->setState(Daemon::WSTATE_IDLE);

        Timer::add(function ($event) {

            if (!Daemon::$runworkerMode) {
                if ($this->IPCManager) {
                    $this->IPCManager->ensureConnection();
                }
            }

            $this->breakMainLoopCheck();
            if (Daemon::checkAutoGC()) {
                EventLoop::$instance->interrupt(function () {
                    gc_collect_cycles();
                });
            }

            $event->timeout();
        }, 1e6 * 1, 'breakMainLoopCheck');
        if (Daemon::$config->autoreload->value > 0) {
            Timer::add(function ($event) {
                static $n = 0;
                $list = get_included_files();
                $s = sizeof($list);
                if ($s > $n) {
                    $slice = array_map('realpath', array_slice($list, $n));
                    Daemon::$process->IPCManager->sendPacket(['op' => 'addIncludedFiles', 'files' => $slice]);
                    $n = $s;
                }
                $event->timeout();
            }, 1e6 * Daemon::$config->autoreload->value, 'watchIncludedFiles');
        }
        EventLoop::$instance->run();
        $this->shutdown();
    }
328176
public function run()
    {
        try {
            return $this
                ->preRun()
                ->check();
        } catch (Exception $e) {
            return $this
                ->setMessage($e->getMessage())
                ->setCode($e->getCode());
        }
    }
1035439
public function run()
    {
        if (isset(\Yii::$app->cmsMarketplace) && \Yii::$app->cmsMarketplace) {
            \Yii::$app->cmsMarketplace->info;
        }

        if ($this->_isRunning === false && $this->_checkAccess()) {
            $this->_isRunning = true;
            static::$_runningBakcend = $this;

            $event = new Event();
            $this->trigger(self::EVENT_BEFORE_RUN, $event);

            $this->_run();

            $event = new Event();
            $this->trigger(self::EVENT_RUN, $event);
        }

        return $this;
    }
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);
    }
613356
public function run()
    {
        $error = $this->error;
        $output = $this->output;

        return $this->builder->getProcess()->run(
            function ($type, $buffer) use ($error, $output) {
                if ('err' === $type) {
                    if ($error) {
                        $error($buffer);
                    }
                } elseif ($output) {
                    $output($buffer);
                }
            }
        );
    }
973456
public function run()
    {
        //Bogus variable set. The original value is never used, but IDEs complain
        $result = new Result();
        $resultArray = array();
        $max = count($this->commands);

        for ($i = 0; $i < $max; ++$i) {
            $cmd = $this->commands[$i];

            if ($i === 0) {
                $resultArray[] = $result = $cmd->run();
                continue;
            }

            if (($cmd->_runMode === RUN_IF_PREVIOUS_SUCCEEDS && $result->getExitCode() !== 0) ||
                ($cmd->_runMode === RUN_IF_PREVIOUS_FAILS && $result->getExitCode() === 0)
            ) {
                continue;
            }

            if ($cmd->_pipe) {
                $stdOut = trim($result->getStdOut());

                $isXArg = false;
                foreach ($cmd as $argIdx => $arg) {
                    if ($arg instanceof Argument) {
                        if (stripos($arg->getKey(true), PIPE_PH) !== false) {
                            $key = str_replace(PIPE_PH, $stdOut, $arg->getKey(true));
                            $arg->setKey($key);
                        }

                        $values = $arg->getValues();
                        foreach ($values as $index => $val) {
                            if (stripos($val, PIPE_PH) !== false) {
                                $val = str_replace(PIPE_PH, $stdOut, $val);
                                $arg->replaceValue($index, $val);
                                $isXArg = true;
                            }
                        }
                    }
                }
                if (!$isXArg) {
                    $cmd->setStdIn($stdOut);
                }
            }

            $resultArray[] = $result = $cmd->run();
        }

        return $resultArray;
    }
321914
public function run()
    {
        if ($this->opts->error !== null) {
            if ($this->opts->error !== '') {
                $top = '{cmd}: ' . $this->opts->error;
            } else {
                $top = '';
            }
            $this->usage($top);
            return $this->io;
        }
        if (!$this->loadOpts()) {
            return $this->io;
        }
        $this->process();
        return $this->io;
    }