/* (non-phpdoc)
@see Controller::execute()
554921
public function execute($request)
	{
		$method = strtolower($request->getRequestMethod());
		if(!in_array($method,array('get','put','post','delete','head')))
		{
			throw new Exception("Unknown HTTP verb");
		}

		$this->setRouter($request->getRouter());

		return $this->$method($request);
	}
797089
private function execute() {

		if(false === $this -> getExecuted()) {

			foreach($this -> rules as $rule) {

				$value = $this -> getValue($rule -> field, $rule -> prefix);

				//Execute custom extended validator
				if($rule -> closure) {

					if(false === call_user_func($rule -> closure, $rule -> field, $value)) {

						$this -> setPasses(false);

						$instance = $this -> getMessageInstance();
						$instance :: setFieldnames([$rule -> field]);
						$instance :: setError($rule -> prefix, $rule -> field, $rule -> message);
					}

					continue;
				}

				//Execute build in validator
				$class = $this -> getRuleClass($rule -> rule);
				$class = new $class();

				//Set rule data
				$class -> setField($rule -> field);
				$class -> setValue($value);
				$class -> setPrefix($rule -> prefix);
				$class -> setParameters($rule -> parameters);
				$class -> setValidateAsArray($this -> isValidateArray($rule -> field));

				if(true === is_callable([$class, 'requestParameters'])) {
					
					$params = call_user_func_array([$class, 'requestParameters'], []);

					foreach($params as $param) {
						
						$value = $this -> getValue($param, $rule -> prefix);
						$class -> setValues($param, $value);
					}
				}

				//Check if rule passes
				if(false === $this -> isRequired($rule -> field, $value) && false === $class -> isValid()) {

					$this -> setPasses(false);
					$this -> setErrorMessage($rule, $class);

					foreach($this -> combine as $combine) {
						
						if($combine -> getName() === $rule -> field) {

							foreach($combine -> getFieldnames() as $fieldname) {

								$rule -> field = $fieldname;
								$this -> setErrorMessage($rule, $class);
							}

							break;
						}
					}
				}
			}

			$this -> setExecuted(true);
		}
	}
823981
final public function execute($options = null)
    {
        return $this
            ->getHttpClient()
            ->request(
                $this->method(), 
                $this->uri(), 
                $options ?: $this->options()
            );
    }
242029
function run()
    {
        $res = $this->resolve();

        $ctrl = isset($res['controller']) && $res['controller'] !== null ? $res['controller'] : $this->defaultController;
        $action = isset($res['action']) && $res['action'] !== null ? $res['action'] : $this->defaultAction;

        //Name format to Controller namespace
        $tmp = explode('\\', str_replace('/', '\\', $ctrl));
        $ctrl = '\\Controller';
        foreach($tmp as $tmp1){
            $ctrl .= '\\'.ucfirst($tmp1);
        }

        //instantiate the controller
        $controller = new $ctrl(['params' => $res['params'], 'request' => $this->request]);

        $this->params = $res['params'];

        if (method_exists($controller, $action))
            return $controller->$action();
        else
            return $controller->{static::$defaultAction}();
    }
1049943
public function execute()
    {
        if (!empty($this->args[1])) {
            $this->args[0] .= "', '".str_replace('\'', '"', $this->args[1]);
        }

        HTML\Generator::call(
            'script',
            array(
                str_replace(':UA:', $this->args[0], self::JS)
            ),
            array(
                'compress',
                'inlineInner',
                'noCache'
            )
        );
    }
126577
private function execute()
    {
        $this->connect();
        try {
            $this->getSyntax();
            $this->read->execute();
            $this->result = $this->read->fetchAll();
        } catch (\PDOException $e) {
            $this->result = null;
            parent::error("<b>Erro ao Ler:</b> {$e->getMessage()}", $e->getCode());
        }

        parent::setDatabase(DATABASE);
    }
1201574
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if (isset($details['RtnCode']) === false) {
            $request->markNew();

            return;
        }

        if ($details['RtnCode'] === '2') {
            $request->markPending();

            return;
        }

        if ($details['RtnCode'] === '1') {
            if (isset($details['Action']) === true) {
                switch ($details['Action']) {
                    case 'C':
                        $request->markCaptured();
                        break;
                    case 'R':
                        $request->markRefunded();
                        break;
                    case 'E':
                    case 'N':
                        $request->markCanceled();
                        break;
                }

                return;
            } else {
                $request->markCaptured();

                return;
            }
        }

        $request->markFailed();
    }
1237165
private function executeController($controller, Route $method, $matches) {

		if(false === is_object($controller)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type object, "%s" given', __METHOD__, gettype($controller)), E_USER_ERROR);
		}

		if(false === is_array($matches)) {
			return trigger_error(sprintf('Argument 2 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($matches)), E_USER_ERROR);
		}

		//Load the module dispatch file if exists and readable
		$this -> loadBoot($method -> getModule());

		//Execute start method if controller supports it
		if(true === is_callable([$controller, '__start'])) {
			call_user_func_array([$controller, '__start'], []);
		}

		//Execute main function
		$action = Application :: get(['prefix', 'action']) . $method -> getAction();

		//Trigger error if main function does not exists
		if(false === is_callable([$controller, $action])) {
			return trigger_error(sprintf('Method "%s" does not exists in "%s" controller', Application :: get(['prefix', 'action']) . ucfirst($method -> getAction()), $method -> getController()), E_USER_ERROR);
		}

		call_user_func_array([$controller, $action], $matches);

		//Execute end method if controller supports it
		if(true === is_callable([$controller, '__end'])) {
			call_user_func_array([$controller, '__end'], []);
		}
	}
1314763
public function execute() {

        $container = $this->getContainer();
        $profiler = $container->has('profiler') ? $container->get('profiler') : false;

        if ($this->get('debug') && $profiler) {
            $this->set('gzip', false);
            ob_start();
            ob_implicit_flush(false);
        }

        if ($profiler) {
            $profiler->mark('beforeExecute');
        }

        // Perform application routines.
        $this->doExecute();

        if ($profiler) {
            $profiler->mark('afterExecute');
        }

        // If gzip compression is enabled in configuration and the server is compliant, compress the output.
        if ($this->get('gzip') && !ini_get('zlib.output_compression') && (ini_get('output_handler') != 'ob_gzhandler'))
        {
            $this->compress();
        }

        if ($profiler) {
            $profiler->mark('beforeRespond');
        }

        // Send the application response.
        $this->respond();

        if ($profiler) {
            $profiler->mark('afterRespond');
            $profiler->mark('end');
            if ($this->mimeType == 'text/html') {

                $contents = ob_get_contents();
                if ($contents) {
                    ob_end_clean();
                }

                echo str_replace('</body>', $profiler->render() . '</body>', $contents);

            } else {
                $profiler->dump($this->get('uri.current'));
            }
        }
    }
714174
public function execute($matches) {
		if (is_string($this->callable)) { // If the callable is a string, call the action of controller
			$params = explode('#', $this->callable);

            if (count($params) == 2) {
                $controllerPrefix = $params[0];
                $controllerPrefix = str_replace(':', '\\', $controllerPrefix);

    			$controller = $controllerPrefix."Controller";

    			$controller = new $controller();
    			$action = $params[1].'Action';

    			return call_user_func_array(array($controller, $action), $matches);


    			return $controller->$action();

            } else {
                throw new RouterException('Invalid controller name '.$this->callable);
            }

		} else { // If the callable is a function, execute the function
			return call_user_func_array($this->callable, $matches);
		}
	}
614616
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $model = ArrayObject::ensureArrayObject($request->getModel());

        if (null === $model['error_code']) {
            $request->markNew();
            return;
        }

        if (self::SUCCESS === $model['error_code']) {
            $request->markCaptured();
            return;
        }

        $request->markFailed();

    }
14602
final public function execute()
    {
        $platform = $this->connection->getDatabasePlatform();
        $queries  = $this->currentSchema->getMigrateToSql($this->schema, $platform);

        foreach ($queries as $query) {
            $this->connection->query($query);
        }
    }
486692
public function execute()
    {
        $command = new \ReflectionClass($this);
        $options = input()->get();

        if (empty($options)) {
            $this->optionHelp();
        } else {

            foreach ($options as $method => $arguments) {

                if (array_key_exists('-' . $method, $this->commandOptionsShortcuts)) {
                    $method = $this->commandOptionsShortcuts[ '-' . $method ];
                }

                $optionMethod = camelcase('option-' . $method);

                if ($command->hasMethod($optionMethod)) {

                    $commandMethod = $command->getMethod($optionMethod);

                    if ($commandMethod->getNumberOfRequiredParameters() == 0) {
                        call_user_func([&$this, $optionMethod]);
                    } elseif ($commandMethod->getNumberOfRequiredParameters() > 0 and empty($arguments)) {
                        if (isset($this->commandOptions[ $method ][ 'help' ])) {
                            output()->write(
                                (new Format())
                                    ->setContextualClass(Format::INFO)
                                    ->setString(language()->getLine('CLI_USAGE') . ':')
                                    ->setNewLinesBefore(1)
                                    ->setNewLinesAfter(1)
                            );

                            output()->write(
                                (new Format())
                                    ->setContextualClass(Format::INFO)
                                    ->setString(language()->getLine($this->commandOptions[ $method ][ 'help' ]))
                                    ->setNewLinesAfter(2)
                            );
                        }
                    } else {
                        $optionArguments = is_array($arguments)
                            ? $arguments
                            : [$arguments];

                        call_user_func_array([&$this, $optionMethod], $optionArguments);
                    }
                }
            }
        }
    }
935512
private function exec( $controller_name, $args )
	{
		// Process controller
		$compo = explode( '@', $controller_name );

		if ( count( $compo ) <= 1 ) {

			throw new Exception( sprintf( 'Controller action must be defined in %s.', $controller_name ) );

		}

		// Get controller
		require_once(  $this->controllers_path . $compo[0] . '.php' );
		$classname = sprintf( $this->namespace . '\Controllers\%s', $compo[0]);
		$controller = new $classname( $this->view );

		if ( !method_exists( $controller, $compo[1] ) ) {

			throw new Exception( sprintf( 'Controller action "%s" not found in %s.', $compo[1], $compo[0] ) );

		}

		return call_user_func_array( [ $controller, $compo[1] ], $args );
	}
570109
public function execute()
    {
        $txt = 'validator_email';
        $domain = '';
        
        $result = filter_var($this->value, FILTER_VALIDATE_EMAIL);
        
        if ($result) {
            
            list ($user, $domain) = explode("@", $this->value);
            
            // Perform dns check of mail domain
            if ($domain) {
                
                $result = checkdnsrr($domain, "MX");
                
                if (!$result) {
                    $txt = 'validator.rule.email.dnscheck';
                }
            }
        }
        
        if (!$result) {
            $this->msg = [
                $txt,
                [
                    $domain
                ]
            ];
        }
    }
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;
    }
94012
public function execute($data = null)
    {
        if ($this->controller->config->get('csrf_protect', true)) {
            CsrfProtection::validate();
        }

        return $this->next->execute($data);
    }