Execute command

@return self Returns itself

@throws Exception on error
166770
public function execute() {
        $this->log
            ->printAsOutput()
            ->info(
                '%s %s',
                $this->config['composer']['extra']['name'],
                $this->config['composer']['extra']['version']
            );

        return $this;
    }
682218
public function execute()
    {
        $groups = array();
        $results = array();
        $currentOperation = null;
        $currentGroup = array();

        foreach ($this->commands as $command) {
            if ($currentOperation !== $command[0]) {
                $groups[] = array($currentOperation, $currentGroup);
                $currentOperation = $command[0];
                $currentGroup = array();
            }
            if ($currentOperation === 'get') {
                $currentGroup[] = $command[1];
            } else {
                $currentGroup[$command[1]] = $command[2];
            }
        }
        $groups[] = array($currentOperation, $currentGroup);
        array_shift($groups);

        foreach ($groups as $group) {
            list($op, $args) = $group;
            if ($op === 'set') {
                $result = $this->backend->setMulti($args, $this->ttl);
                $results = array_merge($results, array_fill(0, count($args), $result));
            } else {
                $results = array_merge($results, $this->backend->getMulti($args));
            }
        }

        $this->commands = array();
        return $results;
    }
243557
protected function execute()
    {
        if ($this->doneExecuted) {
            
            return $this;
        }
        
        $this->doneExecuted = true;
        
        if ($this->def['type'] === 'FILE' && $this->def['method'] === 'GET') {
            $this->executeFile();
        } elseif (in_array($this->def['type'], ['CURL', 'FILE']) && function_exists('curl_init')) {
            $this->executeCurl();
        } else {
            $this->executeSocket();
        }
        // handle success/error callback
        static::callback();
        
        return $this;
    }
656303
public function execute()
    {
        // Init the retry times
        if ($this->retries && is_null($this->leftRetries)) {
            $this->leftRetries = $this->retries;
        }

        // Prepare request
        $ch = $this->ch = curl_init();
        curl_setopt_array($ch, $this->prepareCurlOptions());
        $this->beforeSend && call_user_func($this->beforeSend, $this, $ch);

        // Execute request
        $response = curl_exec($ch);

        // Handle response
        $this->handleResponse($response);
        $this->complete && call_user_func($this->complete, $this, $ch);

        // Retry if response error
        if ($this->result === false && $this->leftRetries > 0) {
            $this->leftRetries--;
            $this->execute();
            return;
        }

        if ($this->throwException && $this->errorException) {
            throw $this->errorException;
        }
    }
700548
public function command(): self
    {
        $parameters = func_get_args();
        $command = strtoupper(array_shift($parameters));
        $parameters = array_map([$this, 'parameter'], $parameters);

        $this->zpl[] = '^' . $command . implode(',', $parameters);

        return $this;
    }
141220
public function execute()
    {
        $this->_setOptions();

        $response = $this->_execute();
        $this->_saveStatusCode();

        $curlErrorNumber = $this->_getErrorNumber();

        $this->_close();

        if ($curlErrorNumber) {
            /**
             * @var \OxidEsales\Eshop\Core\Exception\StandardException $exception
             */
            $exception = oxNew(\OxidEsales\Eshop\Core\Exception\StandardException::class);
            $lang = \OxidEsales\Eshop\Core\Registry::getLang();
            $exception->setMessage(sprintf($lang->translateString('EXCEPTION_CURL_ERROR', $lang->getTplLanguage()), $curlErrorNumber));
            throw $exception;
        }

        return $response;
    }
1177259
public function perform()
    {
        $app = $this->application();

        $command = $this->getConsoleCommand($app);

        $inputDefinition = $this->getInputDefinition($this->args);

        // Create Input object with $this->args loaded as Input arguments
        $input  = new ArrayInput($this->args, $inputDefinition);
        $output = new ConsoleOutput;

        // Output error details to the console if available
        try {
            $command->run($input, $output);
        } catch (\Exception $e) {
            $output->writeln('Exception: '.$e->getMessage());
            $output->writeln('Code: '.$e->getCode());
            $output->writeln('Stack trace: '.$e->getTraceAsString());

            throw $e;
        }
    }
716001
def execute(self, *args):
        """"""
        command, kwargs = self.parse(*args)
        return self._commands.execute(command, **kwargs)
1356319
public function exec($command)
    {
        // Check for prohibited commands
        foreach ($this->prohibitedCommands as $prohibitedCommand) {
            if (strpos(trim($command), $prohibitedCommand) !== false) {
                throw new \Exception('The shell command ' . $command . ' is prohibited');
            }
        }
        return exec($command);
    }
1010230
function execute() {
		try {
			$this->stmt->execute();
		}
		catch (\Exception $pdo_exception) {
			$message = $pdo_exception->getMessage();
			$message .= "\n".$this->formatQuery($this->query);
			throw new Panic($message, 500, $pdo_exception);
		}

		return $this;
	}
490304
public function execute()
    {
        $ch = curl_init();
        $this->setAuth($ch);
        try {
            switch (strtoupper($this->verb)) {
                case 'GET':
                    $this->executeGet($ch);
                    break;
                case 'POST':
                    $this->executePost($ch);
                    break;
                case 'PUT':
                    $this->executePut($ch);
                    break;
                case 'DELETE':
                    $this->executeDelete($ch);
                    break;
                default:
                    throw new \InvalidArgumentException(
                        'Current verb (' . $this->verb
                        . ') is an invalid REST verb.'
                    );
            }
        } catch (\InvalidArgumentException $e) {
            curl_close($ch);
            throw $e;
        } catch (\Exception $e) {
            curl_close($ch);
            throw $e;
        }

        /*
         * check and debug api request total time
         */
        $this->processDebugApi();

        return $this->responseBody;
    }
110264
public function execute()
    {
        foreach ($this->getJobs() as $key => $job) {
            try {
                $this->console($job, $key + 1);
                $task = $this->createTask($job);
                $return = $task->run();
                $this->getAdapter()->history(HistoryInterface::STATUS_OK, $job, is_string($return) ? $return : null);
            } catch (\Exception $exc) {
                $this->log($job, $exc);
            }
        }

        $this->getAdapter()->finishProcessing($this->getJobs());
    }
669768
protected function _exec() {
        $response = curl_exec($this->_ch);
        $this->_last_info = curl_getinfo($this->_ch);
        $error = curl_error( $this->_ch );
        if ( $error ) {
            throw new \Exception($error);
        }

        return $response;
    }
702072
public function execute()
    {
        if (! $this->ch) {
            throw new Exception('Curl request not initiated');
        }

        $statusCode = (int) isset($this->lushOptions['return_status']) ? $this->lushOptions['return_status'] : 200;
        $contentType = isset($this->lushOptions['return_content_type']) ? $this->lushOptions['return_content_type'] : 'text';

        $this->headers['url'] = $this->ch;
        $this->headers['http_code'] = $statusCode;

        $this->executed = true;

        return $this->createResponse($statusCode, $contentType);
    }
419011
private function execute()
    {
        $query = $this->qb->getQuery();

        if (true === $this->configs['translation_query_hints']) {
            if (true === $this->doctrineExtensions) {
                $query->setHint(
                    \Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER,
                    'Gedmo\\Translatable\\Query\\TreeWalker\\TranslationWalker'
                );

                $query->setHint(
                    \Gedmo\Translatable\TranslatableListener::HINT_TRANSLATABLE_LOCALE,
                    $this->locale
                );

                $query->setHint(
                    \Gedmo\Translatable\TranslatableListener::HINT_FALLBACK,
                    1
                );
            } else {
                throw new \Exception('execute(): "DoctrineExtensions" does not exist.');
            }
        }

        $query->setHydrationMode(Query::HYDRATE_OBJECT);

        return $query;
    }
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);
    }
1311668
public function execute()
    {
        $this->_setOptions();

        $sResponse = $this->_execute();
        $this->_saveStatusCode();

        $iCurlErrorNumber = $this->_getErrorNumber();

        $this->_close();

        if ($iCurlErrorNumber) {
            $host = $this->getUrl();
            $parameters = http_build_query($this->getParameters(), "", "&");
            $message = $this->_getErrorMessage($iCurlErrorNumber);
            throw new Exception("cURL failed with message '$message' when calling '$host?$parameters'");
        }

        return $sResponse;
    }