Runs the action

@return bool

@throws BadRequestHttpException
163502
public function run()
    {
        $model = $this->findModelOrCreate();
        $attribute = $this->getModelAttribute();
        $value = Yii::$app->request->post('value');

        if ($this->preProcess && is_callable($this->preProcess, true)) {
            call_user_func($this->preProcess, $model);
        }

        $model->setScenario($this->scenario);
        $model->$attribute = $value;

        if ($model->validate([$attribute])) {
            return $model->save(false);
        } else {
            throw new BadRequestHttpException($model->getFirstError($attribute));
        }
    }
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);
        }
    }
1250528
public function run()
    {
        $resolvedRequest = $this->router->route($this->request);
        echo $this->dispatcher->dispatch($resolvedRequest);
    }
15217
public function run()
    {
        if ($this->driver === null || (is_array($this->driver) && !isset($this->driver['__class']))) {
            $this->driver['__class'] = GdDriver::class;
        }

        $this->driver = $this->app->ensureObject($this->driver, DriverInterface::class);

        if ($this->app->request->getQueryParam(self::REFRESH_GET_VAR) !== null) {
            // AJAX request for regenerating code
            $code = $this->getVerifyCode(true);
            $this->app->response->format = Response::FORMAT_JSON;
            return [
                'hash1' => $this->generateValidationHash($code),
                'hash2' => $this->generateValidationHash(strtolower($code)),
                // we add a random 'v' parameter so that FireFox can refresh the image
                // when src attribute of image tag is changed
                'url' => Url::to([$this->id, 'v' => uniqid()]),
            ];
        }

        $this->setHttpHeaders();
        $this->app->response->format = Response::FORMAT_RAW;

        return $this->driver->renderImage($this->getVerifyCode());
    }
108358
public function run()
    {
        $ch = curl_init();

        $query = '';
        if (!empty($this->parameters)) {
            $query = '?' . http_build_query ($this->parameters);
        }
        $this->query = $this->url . $query;
        if ($this->method == "GET") {
            curl_setopt($ch, CURLOPT_URL, $this->url . $query);
        } else {
            curl_setopt($ch, CURLOPT_URL, $this->url);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
        }

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        foreach ($this->options as $key => $value)
        {
            curl_setopt($ch, $key, $value);
        }

        $this->response = curl_exec($ch);
        $this->curlInfo = curl_getinfo($ch);
        $this->curlError = curl_error($ch);
    }
915245
private function runAction()
    {
        // Get URL
        $url = $this->request->url();

        // Get route action
        $action = $this->router->getAction($url);

        // Perform the filter
        if ($action['filter']) {
            $filter = $this->router->performFilter($action['filter']);
        }

        // Check if the controller exists
        if (!isset($action) || !is_string($action['class']) || !class_exists($action['class'])) {
            throw new \Exception('Controller not found', 404);
        }

        // Create the required controller
        $controller = $this->make($action['class']);

        // Execute the required method and return the response
        return $this->response->output(call_user_func_array([$controller, $action['method']], $action['params']? : []));
    }
1101870
public function run()
    {
        if (request()->ajax()) {
            return $this;
        }
        if (!isset($_SESSION) && php_sapi_name() !== 'cli') {
            session_start();
        }
        $interval = array_get($this->config, 'interval', 5);
        if (isset($_SESSION['last_request_count']) && $_SESSION['last_session_request'] > (time() - $interval)) {
            if (empty($_SESSION['last_request_count'])) {
                $_SESSION['last_request_count'] = 1;
            } elseif ($_SESSION['last_request_count'] < $interval) {
                $_SESSION['last_request_count'] = $_SESSION['last_request_count'] + 1;
            } elseif ($_SESSION['last_request_count'] >= $interval) {
                $this->ban();
                echo response('', 302)->header('Location', array_get($this->config, 'redirect', '/index.html'))->send();
                return app()->abort(302);
            }
        } else {
            $_SESSION['last_request_count'] = 1;
        }
        $_SESSION['last_session_request'] = time();
        return $this;
    }
867838
public function run()
    {
        $this->requestId = uniqid();
        $this->startTime = microtime();

        try {
            // Generate a Request object from the data available in the
            // current running environment.
            try {
            $requestFactory = new Requests\Factories\Http;
            $request = $requestFactory->get($this);
                // Set the application locale from the request.
                // TODO: Move into the Request constructor?
                $this->setLocale($request->getLocale());
                // Run the process of responding to the request.
                $this->issueResponse($request);
            } catch (\Throwable $throwable) {
                // There was an error somewhere during the request
                // creation, or somewhere during the response building
                // process.
                $errorRequest = new Requests\Http\Error;
                $errorRequest->setThrowable($throwable);
                $this->issueResponse($errorRequest, $throwable);
            }
        } catch (\Exception $exception) {
            // There was an error while trying to fail gracefully.
            // Little else can be done now.
            $this->fail($exception);
        }

        Logger::get()->info($this->getStats());

        // Since the application is being run in an HTTP context, and
        // PHP is the scripting language it is, the application cycle
        // just finishes after the response is done with its tasks.
    }
1253994
public function run()
    {
        //return Html::tag($this->tagName, $this->encodeLabel ? Html::encode($this->label) : $this->label, $this->options);
        $html = '';
        if ($this->image !== null) {
            $html .= $this->renderImage();
        }
        if ($this->content !== null) {
            $html .= $this->renderContent();
        }
        if ($this->action !== null) {
            $html .= $this->renderAction();
        }
        if ($this->defaultClass) {
            Html::addCssClass($this->options, $this->defaultClass);
        }
        return Html::tag('div', $html, $this->options);
    }
1150542
public function run()
    {
        $request = $this->getService('requestStack')->getMasterRequest();
        $this->getPreProcesses()->execute($request);
        $response = $this->getFrontController()->call($request);
        $this->getPostProcesses()->execute($response);
        $response->send();
    }
682482
public function run()
    {
        if ($this->hasModel()) {
            $input = Html::activeTextInput($this->model, $this->attribute, $this->options);
            $this->emailId = Html::getInputId($this->model, $this->emailAttribute);
            $this->formName = $this->model->formName();
        } else {
            //TODO We should not support this.
            $input = Html::textInput($this->name, $this->value, $this->options);
            $this->emailId = $this->name .'_'. $this->getId;
            $this->formName = '';
        }
        $this->registerClientScript();
        $action = Html::a($this->actionLabel, 'javascript:void(0);', $this->actionOptions);
        echo strtr($this->template, [
            '{input}' => $input,
            '{action}' => $action,
        ]);
    }
49818
public function run()
    {
        // The MVP process is here ...
        /* @var Psr\Http\Message\ResponseInterface $response */
        $response  = $this->getResponse();
        $presenter = $this->getPresenter();
        $action    = $this->getAction();
        $view      = $this->getView();

        // Use inofficial standard "xAction()"
        $method = $action.'Action';

        // Validate that request mapped to a route (foo:bar) can be executed by Doozr
        if (true === $httpStatus = $this->validateRequest($presenter, $method)) {

            // If we have a view attach it
            if (null !== $view && $view instanceof Doozr_Base_View) {
                $presenter->attach($view);
            }

            // Call the requested Action on requested Presenter (Presenter:Action)
            $data = $presenter->{$method}();

            // Create a response body with write access
            $responseBody = new Doozr_Response_Body('php://memory', 'w');
            $responseBody->write($data[Doozr_Base_Presenter::IDENTIFIER_VIEW]);

            $response = $response->withBody($responseBody);
            $response = $response->withStatus(Doozr_Http::OK);
        } else {
            // So if the Status is not TRUE (successful) it contains an integer for HTTP Response :)
            switch ($httpStatus) {
                case Doozr_Http::BAD_REQUEST:
                    $message = sprintf(
                        'No Presenter to execute route ("%s"). Sure it exists?',
                        $this->getRoute()
                    );
                    break;

                case Doozr_Http::NOT_FOUND:
                default:
                    $message = sprintf(
                        'Method "%s()" of class "%s" not callable. Sure it exists and it\'s public?',
                        $method,
                        'Presenter_'.ucfirst($this->getClassName())
                    );
                    break;
            }

            throw new Doozr_Route_Exception(
                $message,
                $httpStatus
            );
        }

        // Return all data returned and fetched in data
        return $response;
    }
1272125
public function run()
    {
        // Creates the current controller instance
        $this->controller = new $this->controller($this->twig);

        // Calls the action method on the controller
        $response = call_user_func([$this->controller, $this->action]);

        // Shows the response
        echo $response;
    }
765726
public function run()
    {
        $this->executed = true;

        if ($this->client instanceof ClientInterface) {
            $this->client->sendRequest();
        } else {
            $connection = new Connection($this->config);
            $executor = new Executor($connection);
            $executor->execQuery($this->query);
        }

        return $this->hasError();
    }
1078552
public function run()
    {
        $this->symfony->getDefinition()->addOption(
            new InputOption('config', 'c', InputOption::VALUE_REQUIRED, 'Path to steak configuration file', null)
        );

        return $this->symfony->run(null, $this->output);
    }
1184722
public function run()
    {
        $id = yii::$app->getRequest()->get($this->paramSign, null);
        if (! $id) throw new BadRequestHttpException(yii::t('app', "{$this->paramSign} doesn't exit"));
        /* @var $model yii\db\ActiveRecord */
        $model = call_user_func([$this->modelClass, 'findOne'], $id);
        if (! $model) throw new BadRequestHttpException(yii::t('app', "Cannot find model by $id"));
        $model->setScenario( $this->scenario );

        if (yii::$app->getRequest()->getIsPost()) {
            if ($model->load(Yii::$app->getRequest()->post()) && $model->save()) {
                if( yii::$app->getRequest()->getIsAjax() ){
                    yii::$app->getSession()->setFlash('success', yii::t('app', 'Update Success'));
                    return [];
                }else {
                    yii::$app->getSession()->setFlash('success', yii::t('app', 'Update Success'));
                    if( $this->successRedirect ) return $this->controller->redirect($this->successRedirect);
                    return $this->controller->refresh();
                }
            } else {
                $errors = $model->getErrors();
                $err = '';
                foreach ($errors as $v) {
                    $err .= $v[0] . '<br>';
                }
                if( yii::$app->getRequest()->getIsAjax() ){
                    throw new UnprocessableEntityHttpException($err);
                }else {
                    yii::$app->getSession()->setFlash('error', $err);
                }
                $model = call_user_func([$this->modelClass, 'findOne'], $id);
            }
        }

        $this->viewFile === null && $this->viewFile = $this->id;
        $data = [
            'model' => $model,
        ];
        if( is_array($this->data) ){
            $data = array_merge($data, $this->data);
        }elseif ($this->data instanceof \Closure){
            $data = call_user_func_array($this->data, [$model, $this]);
        }
        return $this->controller->render($this->viewFile, $data);
    }
778470
public function run()
    {
        if ($this->runningInConsole()) {
            $kernel = $kernel = static::make('ConsoleKernel');

            $input = new Input();
            $output = new Output();

            $status = $kernel->handle($input, $output);

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

            exit($status);
        }
        else {
            $kernel = static::make('HttpKernel');

            $request = Request::createFromGlobals();
            $request::enableHttpMethodParameterOverride();
            $request->enableHttpRequestParameterOverride();
            $response = $kernel->handle($request);

            $response->send();

            $kernel->terminate($request, $response);
        }

        return true;
    }