Execute server generator backend.
@return void
@throws Exception
178840
public function serverResponse()
    {
        if(!empty($_GET['imageQuery']))
        {
            $picture  = $this->loadPicture($_GET['imageQuery']);
            $savePath = $this->getPath($picture);

            $picture->save($savePath);

            if($savePath !== $this->getPath($picture))
            {
                throw new Exception('Picture effect is changing its own arguments on effect apply');
            }

            $picture->output();
        }

        if(!empty($_POST['regenerate']))
        {
            $picture = $this->loadPicture($_POST['regenerate']);
            $picture->save($this->getPath($picture));
        }
    }
675020
public function run()
    {
        foreach ($this->getSteps() as $step) {
            $this->logger->info('Starting "'.$step->getTitle().'"');

            foreach ($this->getServersForStep($step) as $server) {
                if ($step->isMandatory()) {
                    $server->runCommands();
                    $this->logger->info('Finished "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                } else {
                    try {
                        $server->runCommands();
                        $this->logger->info('Finished "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                    } catch (\Exception $e) {
                        $this->logger->info('Failed to run "'.$step->getTitle().'" on "'.$server->getTitle().'"');
                    }
                }
            }
        }
    }
910275
public function run()
    {
        if (!($controller = \Devil::app()->url->getNext())) {
            $controller = 'site';
        }
        if ($controller = $this->loadController($controller)) {
            if (!$nextUrl = \Devil::app()->url->getNext()) {
                $nextUrl = 'index';
            }
            $controller->performAction(NamesHelper::urlToClass($nextUrl));
        } else {
            throw new HttpException(HttpException::NOT_FOUND);
        }
    }
16377
public function run()
	{
		header('Content-Type: text/xml;charset='.$this->encoding);
		if(YII_DEBUG)
			ini_set("soap.wsdl_cache_enabled",0);
		$server=new SoapServer($this->wsdlUrl,$this->getOptions());
		Yii::app()->attachEventHandler('onError',array($this,'handleError'));
		try
		{
			if($this->persistence!==null)
				$server->setPersistence($this->persistence);
			if(is_string($this->provider))
				$provider=Yii::createComponent($this->provider);
			else
				$provider=$this->provider;

			if(method_exists($server,'setObject'))
			{
				if (is_array($this->generatorConfig) && isset($this->generatorConfig['bindingStyle'])
					&& $this->generatorConfig['bindingStyle']==='document')
				{
					$server->setObject(new CDocumentSoapObjectWrapper($provider));
				}
				else
				{
					$server->setObject($provider);
				}
			}
			else
			{
				if (is_array($this->generatorConfig) && isset($this->generatorConfig['bindingStyle'])
					&& $this->generatorConfig['bindingStyle']==='document')
				{
					$server->setClass('CDocumentSoapObjectWrapper',$provider);
				}
				else
				{
					$server->setClass('CSoapObjectWrapper',$provider);
				}
			}

			if($provider instanceof IWebServiceProvider)
			{
				if($provider->beforeWebMethod($this))
				{
					$server->handle();
					$provider->afterWebMethod($this);
				}
			}
			else
				$server->handle();
		}
		catch(Exception $e)
		{
			if($e->getCode()!==self::SOAP_ERROR) // non-PHP error
			{
				// only log for non-PHP-error case because application's error handler already logs it
				// php <5.2 doesn't support string conversion auto-magically
				Yii::log($e->__toString(),CLogger::LEVEL_ERROR,'application');
			}
			$message=$e->getMessage();
			if(YII_DEBUG)
				$message.=' ('.$e->getFile().':'.$e->getLine().")\n".$e->getTraceAsString();

			// We need to end application explicitly because of
			// http://bugs.php.net/bug.php?id=49513
			Yii::app()->onEndRequest(new CEvent($this));
			$server->fault(get_class($e),$message);
			exit(1);
		}
	}
371425
protected function doExecute()
    {
        if ($this->console->getMode() !== 'dev') {
            throw new \RuntimeException(
                '<error>STOP!</error> please run <info>' . $this->getEnvCmd() . '</info>.'
            );
        }

        if (!$this->getOption('no-backup')) {
            // backup
            BackupRepository::getInstance()->setCommand($this)->backup();
        }

        $class = $this->console->get('seed.class');

        /** @var \Windwalker\Core\Seeder\AbstractSeeder $seeder */
        $seeder = $this->console->container->newInstance($class, ['command' => $this]);

        try {
            $this->console->container->call([$seeder, 'doExecute']);
        } catch (\PDOException $e) {
            if ($this->getOption('v')) {
                $this->out("\n\nError SQL: " . $this->console->database->getQuery());
            }

            throw $e;
        }

        return true;
    }
416675
public function exec()
    {
        $process = Seeds::exec();
        //
        $this->show($process);
        $this->backup($process);
    }
1267293
public function exec(): void
    {
        $this->queryExecuted = false;
        $sql = $this->getSQL();
        $adapter = $this->getAdapter();

        $adapter->prepare($sql);
        $bindings = $this->getBindings();

        try {
            foreach ($bindings->getBindings() as $bind) {
	            $adapter->getStatement()->bindValue($bind->getParameter(), $bind->getValue(), $bind->getType());
            }

	        $adapter->getStatement()->execute();

            Log::sql("{$this->adapter}>>>\n{$this->debug()}");
        } catch (PDOException $e) {
            // more descriptive error handling when query fails

            switch ($e->getCode()) {
                case 'HY093': // PDO miss match parameter count
                    //Log::debug("[{$e->getCode()}] Tried and failed to execute SQL query:\n{$sql}");
                    //Log::debug('BINDINGS', $bindings->getAsArray());
	                $exception = new QueryException("[{$e->getCode()}] Query bindings parameter miss match: {$e->getMessage()}", (int) $e->getCode(), $e);
                    break;

                default:
                    //Log::debug("[{$e->getCode()}] Tried and failed to execute SQL query:\n{$this->debug()}");
	                $exception = new QueryException("[{$e->getCode()}] Tried and failed to execute SQL query: {$e->getMessage()}", (int) $e->getCode(), $e);
                    break;
            }

            $exception->setAdapter($adapter->getConfigKey());
	        $exception->setSql($this->debug());
	        $exception->setBindings($bindings);
	        $exception->setWasPrepared(true);
            throw $exception;
        }

        $this->queryExecuted = true;
    }
543647
public function execute()
    {
        if (!file_exists($this->location)) {
            mkdir($this->location);
        }
        if (!is_writable($this->location)) {
            throw new \Exception(sprintf('The location %s is not writable or does not exist.', $this->location));
        }

        $pdepend = $this->phpci->findBinary('pdepend');

        $cmd = $pdepend . ' --summary-xml="%s" --jdepend-chart="%s" --overview-pyramid="%s" %s "%s"';

        $this->removeBuildArtifacts();

        // If we need to ignore directories
        if (count($this->phpci->ignore)) {
            $ignore = ' --ignore=' . implode(',', $this->phpci->ignore);
        } else {
            $ignore = '';
        }

        $success = $this->phpci->executeCommand(
            $cmd,
            $this->location . DIRECTORY_SEPARATOR . $this->summary,
            $this->location . DIRECTORY_SEPARATOR . $this->chart,
            $this->location . DIRECTORY_SEPARATOR . $this->pyramid,
            $ignore,
            $this->directory
        );

        $config = $this->phpci->getSystemConfig('phpci');

        if ($success) {
            $this->phpci->logSuccess(
                sprintf(
                    "Pdepend successful. You can use %s\n, ![Chart](%s \"Pdepend Chart\")\n
                    and ![Pyramid](%s \"Pdepend Pyramid\")\n
                    for inclusion in the readme.md file",
                    $config['url'] . '/build/pdepend/' . $this->summary,
                    $config['url'] . '/build/pdepend/' . $this->chart,
                    $config['url'] . '/build/pdepend/' . $this->pyramid
                )
            );
        }

        return $success;
    }
867658
public function run()
    {
        Assertion::notEmpty(
            $this->loaders,
            'No loader attached.',
            DataAggregatorException::NO_LOADER_ATTACHED
        );

        foreach ($this->loaders as $identifier => $loader) {
            $this->executeLoader($loader);
        }
    }
491253
public function run()
    {
        $port = (int) $this->arg->options('--port', 5000);

        $hostname = $this->arg->options('--host', 'localhost');

        $settings = $this->arg->options('--php-settings', false);

        if (is_bool($settings)) {
            $settings = '';
        } else {
            $settings = '-d '.$settings;
        }

        // resource.
        $writing_stream = fopen("php://stdout", "w");

        $message = sprintf(
            "[%s] Server start at http://%s:%s \033[0;31;7mCTRL-C for shutdown it\033[00m\n",
            date('F d Y H:i:s a'),
            $hostname,
            $port
        );

        fwrite($writing_stream, $message);

        // Close Open stream
        fclose($writing_stream);

        $filename = $this->setting->getServerFilename();
        $public_directory = $this->setting->getPublicDirectory();

        // Launch the dev server.
        shell_exec(
            "php -S $hostname:$port -t {$public_directory} ".$filename." $settings"
        );
    }
250413
public function run()
    {
        try {

            // ~ Hook for console help
            if (! $this->argument->has('name')) {

                // ~ Display Help
                $this->help();

                // ~ If no help asked, throw exception !
                if (! $this->argument->has('help')) {
                    throw new \Exception(__METHOD__ . '|Script name must be defined !');
                }

                return;
            }

            // ~ Create new object '*'
            $className = $this->argument->get('name');
            $script = new $className();

            if (!($script instanceof ConsoleInterface)) {
                throw new \Exception('Current script must be implement ConsoleInterface interface !');
            }

            if (! $script->executable()) {
                throw new \Exception(__METHOD__ . '|Script is not executable !');
            }

            $style = new Style(' >>> RUN - ' . $className . ' - ' . date('Y-m-d H:i:s') . ' <<<');
            $style->color('fg', Style::COLOR_GREEN);

            if ($this->argument->has('help')) {

                Out::std($style->get());

                $script->help();
            } else {

                // ~ Execute this method before starting main script method
                $script->before();

                // ~ Display header script only after execution of before method (prevent error with start_session() for example).
                Out::std($style->get());

                // ~ Execute main script method.
                $script->run();

                // ~ Execute this method after execution of main script method.
                $script->after();
            }
        } catch (\Exception $exception) {

            if (! $this->isVerbose) {
                throw $exception;
            }

            $style = new Style(' ~~ EXCEPTION[' . $exception->getCode() . ']: ' . $exception->getMessage());
            $style->color('bg', Style::COLOR_RED);
            Out::std(PHP_EOL . $style->get());

            if ($this->argument->has('debug')) {
                echo $exception->getTraceAsString(), PHP_EOL;
            }
        }
    }
1340484
public function run()
    {

        try {
            // register the default autoloader
            require SERVER_AUTOLOADER;

            // register shutdown handler
            set_error_handler(array(&$this, 'errorHandler'));
            register_shutdown_function(array(&$this, 'shutdown'));

            // initialize the array for the errors
            $this->errors = array();

            // synchronize the application instance and register the class loaders
            $application = $this->application;
            $application->registerClassLoaders();

            // register the applications annotation registries
            $application->registerAnnotationRegistries();

            // synchronize the valves, servlet request/response
            $valves = $this->valves;
            $servletRequest = $this->servletRequest;
            $servletResponse = $this->servletResponse;

            // load the session and the authentication manager
            $sessionManager = $application->search(SessionManagerInterface::IDENTIFIER);
            $authenticationManager = $application->search(AuthenticationManagerInterface::IDENTIFIER);

            // inject the sapplication and servlet response
            $servletRequest->injectContext($application);
            $servletRequest->injectResponse($servletResponse);
            $servletRequest->injectSessionManager($sessionManager);
            $servletRequest->injectAuthenticationManager($authenticationManager);

            // prepare the request instance
            $servletRequest->prepare();

            // initialize static request and application context
            RequestHandler::$requestContext = $servletRequest;
            RequestHandler::$applicationContext = $application;

            // add the application instance to the environment
            Environment::singleton()->setAttribute(EnvironmentKeys::APPLICATION, $application);

            // create a simulated request/session ID whereas session equals request ID (as long as session has NOT been started)
            Environment::singleton()->setAttribute(EnvironmentKeys::REQUEST_ID, $requestId = SessionUtils::generateRandomString());
            Environment::singleton()->setAttribute(EnvironmentKeys::SESSION_ID, $requestId);

            // process the valves
            foreach ($valves as $valve) {
                $valve->invoke($servletRequest, $servletResponse);
                if ($servletRequest->isDispatched() === true) {
                    break;
                }
            }

            // flush the session manager
            $sessionManager->flush();

            // profile the request if the profile logger is available
            if ($profileLogger = $application->getInitialContext()->getLogger(LoggerUtils::PROFILE)) {
                $profileLogger->appendThreadContext('request-handler');
                $profileLogger->debug($servletRequest->getUri());
            }

        } catch (\Exception $e) {
            $this->addError(ErrorUtil::singleton()->fromException($e));
        }

        // re-attach request and response instances
        $this->servletRequest = $servletRequest;
        $this->servletResponse = $servletResponse;
    }
251158
public static function serve()
    {
        $output = new NullOutput();

        $daux = new Daux(Daux::LIVE_MODE, $output);
        $daux->initializeConfiguration();

        $class = $daux->getProcessorClass();
        if (!empty($class)) {
            $daux->setProcessor(new $class($daux, $output, 0));
        }

        // Set this critical configuration
        // for the tree generation
        $daux->getParams()['index_key'] = 'index';

        // Improve the tree with a processor
        $daux->generateTree();

        $server = new static($daux);

        try {
            $page = $server->handle();
        } catch (NotFoundException $e) {
            $page = new ErrorPage('An error occured', $e->getMessage(), $daux->getParams());
        }

        $server->createResponse($page)->prepare($server->request)->send();
    }
355208
public function run()
    {
        if (PHP_SAPI === 'cli' && is_subclass_of($this, ConsoleAppInterface::class))
        {
            $this->execConsoleApp();
        }
        else if (is_subclass_of($this, WebAppInterface::class))
        {
            $this->execWebApp();
        }
        else
        {
            throw new \Exception("No interface was implemented");
        }
    }
751412
public function handle()
    {
        parent::handle();

        $requestGenerator = new RequestGenerator($this->commandData);
        $requestGenerator->generate();

        $this->performPostActions();
    }
867776
private function execute()
	{
		if ($this->currentRoute == null) {
			$this->router->getRoute('error_page')->setAction('_notFound');
			$this->toRoute('error_page');
			return;
		}
		$controllerName = $this->currentRoute->getController();
		if ($controllerName == '') {
			if ($this->currentRoute->getParams() != null && array_key_exists('controller', $this->currentRoute->getParams()))
				$controllerName = $this->currentRoute->getParams()['controller'];
			elseif ($this->currentRoute->getDefault() != null)
				$controllerName = $this->currentRoute->getDefault()->getController();
			else {
				throw new \Exception($this->translator->translate("The requested url has a bad route configuration!"));
			}
		}

		if (array_key_exists($controllerName, $this->invokable))
			$controllerName = $this->invokable[$controllerName];
		elseif (strpos($controllerName, 'decoy\base') === false)
			throw new \Exception('The requested Controller: \'' . $controllerName . '\' is not registered!');
		$c = new $controllerName($this);
		if ($c->getResult() && !in_array($c->identifier, $this->disableRender) && $this->enableRender) {
			echo $this->response->output($c);
		}
	}
1045166
public function handle()
    {
        $tableConfigFile = $this->input->getOption('config');
        if ($tableConfigFile && ! file_exists($tableConfigFile)) {
            throw new \Exception(sprintf('The configuration file "%s" does not exist!', $tableConfigFile));
        }

        if ($tableConfigFile) {
            $tableConfig = include_once( $tableConfigFile );
        }
        if ( ! empty( $tableConfig )) {
            self::$tables = $tableConfig;
        }

        $this->createTables();
    }