Execute the chain.
@param array $args
@return mixed
3679
public function run(array $args) {
		foreach($this->calls as $call) {
			if($call instanceof \SuperClosure\SerializableClosure)
				$call = $call->getClosure();
			$res = call_user_func_array($call, array_merge([$this], $args));
			$this->executed++;
			if($res !== null)
				return $res;
			if(!$this->continue)
				return;
		}
	}
1286956
public function executeOne($arguments = array())
    {
        $result = $this->execute($arguments);
        if (is_array($result) && count($result) > 0) {
            $result = $result[0];
        }
        return $result;
    }
200514
public function executeCommand($args = array())
    {
        $this->lastOutput = array();

        $command = call_user_func_array('sprintf', $args);
        $this->logger->logDebug($command);

        if ($this->quiet) {
            $this->logger->log('Executing: ' . $command);
        }

        $status = 0;
        $descriptorSpec = array(
            0 => array("pipe", "r"),  // stdin
            1 => array("pipe", "w"),  // stdout
            2 => array("pipe", "w"),  // stderr
        );

        $pipes = array();
        $process = proc_open($command, $descriptorSpec, $pipes, $this->buildPath, null);

        if (is_resource($process)) {
            fclose($pipes[0]);

            stream_set_blocking($pipes[1], 0);
            stream_set_blocking($pipes[2], 0);

            $lastOutput = '';
            $lastError  = '';
            do {
                usleep(200); //Give It Time To Start

                while (($newData = fread($pipes[1], 1024)) && !feof($pipes[1])) {
                    $lastOutput .= $newData;
                }

                while (($newData = fread($pipes[2], 1024)) && !feof($pipes[2])) {
                    $lastError .= $newData;
                }

                $processStatus = proc_get_status($process);
            } while ($processStatus['running']);

            $this->lastOutput = $lastOutput;
            $this->lastError  = $lastError;

            fclose($pipes[1]);
            fclose($pipes[2]);

            proc_close($process);
            $status = $processStatus['exitcode'];
        }

        $this->lastOutput = array_filter(explode(PHP_EOL, $this->lastOutput));

        $shouldOutput = ($this->logExecOutput && ($this->verbose || $status != 0));

        if ($shouldOutput && !empty($this->lastOutput)) {
            $this->logger->log($this->lastOutput);
        }

        if (!empty($this->lastError)) {
            $this->logger->log("\033[0;31m" . $this->lastError . "\033[0m", LogLevel::ERROR);
        }

        $rtn = false;

        if ($status == 0) {
            $rtn = true;
        }

        return $rtn;
    }
330840
public function execute(array $args = [], array $options = [])
    {
        $options += [
            'format' => $this->getDefaultFormat(),
            'encode' => 'raw',
        ];

        $s = $this->getConfigService();

        switch ($options['format']) {
            case 'env':
                $s->setDumper(new ConfigDumper\ShellEnvironmentConfigDumper());
                break;
            case 'json':
                $s->setDumper(new ConfigDumper\JsonConfigDumper());
                break;
            case 'php':
                $s->setDumper(new ConfigDumper\PhpConfigDumper());
                break;
            case 'serialized':
                $s->setDumper(new ConfigDumper\SerializedConfigDumper());
                break;
            case 'yaml':
                $s->setDumper(new ConfigDumper\YamlConfigDumper());
                break;
            default:
                throw new \RuntimeException(sprintf("Unsupported format '%s'", $options['format']), 3);
        }

        switch ($options['encode']) {
            case 'base64':
                $s->addDumpEncoder(new DumpEncoder\Base64DumpEncoder());
                break;
            case 'sha1':
                $s->addDumpEncoder(new DumpEncoder\Sha1DumpEncoder());
                break;
            case 'md5':
                $s->addDumpEncoder(new DumpEncoder\Md5DumpEncoder());
                break;
            case 'raw':
                break;
            default:
                throw new \RuntimeException(sprintf("Unsupported dump encoder '%s'", $options['encoder']), 3);
        }

        $s->addPrinter(new Printer\ConsolePrinter());

        $input = $this->getInput();

        if (null === $input) {
            throw new \RuntimeException('No input available for command', 10);
        }

        $output = $this->getOutput();

        if (null === $output) {
            throw new \RuntimeException('No output available for command', 11);
        }

        $s->processLoaded($input, $output, $this->getData());
    }
785165
protected static function runCallback($callback, $args)
    {
        if (!is_array($args)) {
            $args = isset($args) ? array($args) : array();
        }
        return call_user_func_array($callback, $args);
    }
634350
public function execute(array $args, array $options = [])
    {
        $this->bootstrap($args, $options);

        $format = isset($options['format']) ? $options['format'] : $options['f'];

        if (null !== $format) {
            Output::writeln('using format ' . $format);
        }

        $this->getManager()->printStatus($format);
    }
969737
public function execute($callable, array $args = [], $context = null)
    {
        if ($callable instanceof \Closure) {
            $ref = new \ReflectionObject($callable);

            $args = $this->getMethodArgs($ref->getMethod('__invoke'), $args);
        } else {
            if (is_string($callable)) {
                $callable = explode('::', $callable);
            }

            list($object, $method) = $callable;

            $ref = new \ReflectionClass($object);

            $args = $this->getMethodArgs($ref->getMethod($method), $args);
        }

        $closure = function () use ($args, $callable) {
            switch (count($args)) {
                case 0:
                    return $callable();
                case 1:
                    return $callable($args[0]);
                case 2:
                    return $callable($args[0], $args[1]);
                case 3:
                    return $callable($args[0], $args[1], $args[2]);
                case 4:
                    return $callable($args[0], $args[1], $args[2], $args[3]);
                default:
                    return call_user_func_array($callable, $args);
            }
        };

        if ($context) {
            $closure = $closure->bindTo($context, $context);
        }

        return $closure();
    }
892981
public function execute($javascript, array $args = array())
    {
        $response = $this->request('POST', 'execute', json_encode(array(
            'script' => $javascript,
            'args'   => $args
        )));

        $data = json_decode($response->getContent(), true);

        return $data['value'];
    }
400814
public function execute(array $args, array $options = [])
    {
        $rootDir = null;
        if (isset($options['root-dir']) && !empty($options['root-dir'])) {
            $rootDir = $options['root-dir'];
        }
        StaticResource::createSymbolicLink($rootDir);
    }
1151736
public function execute(array $args, array $options = [])
    {
        $this->bootstrap($args, $options);

        $version = isset($options['target']) ? $options['target'] : $options['t'];
        $removeAll = isset($options['remove-all']) ? $options['remove-all'] : $options['r'];

        if ($version && $removeAll){
            throw new \InvalidArgumentException('Cannot toggle a breakpoint and remove all breakpoints at the same time.');
        }

        // Remove all breakpoints
        if ($removeAll){
            $this->getManager()->removeBreakpoints();
        } else {
            // Toggle the breakpoint.
            $this->getManager()->toggleBreakpoint($version);
        }
    }
986971
public function run( $args )
    {
        $this->command = $this->getCommand( $args );

        if ( NULL == $this->command )
        {
            throw new CommandException( 'Command: ' . $args[ 1 ] . ' not found' );
        }

        $this->processArgs( $this->command, $args );

        return $this->command->execute();
    }
819599
public function execute(array $args = [], array $options = [])
    {
        if (!$this->evaluate($this->condition)) {
            return;
        }

        $this->command->execute($args, $options);
    }
869932
function chain($funcs,$args=NULL) {
		$out=[];
		foreach (is_array($funcs)?$funcs:$this->split($funcs) as $func)
			$out[]=$this->call($func,$args);
		return $out;
	}
1196309
public function run($args)
    {
        $args = $this->parseArgs($args);

        if (!isset($args[0]) || !$args[0] || !$this->isPackageName($args[0])) {
            return $this->error('&require-package');
        }

        if (!is_dir($this->cwd.'/vendor/'.$args[0])) {
            return $this->error('&package-not-found');
        }

        $packageName = $args[0];
        $projectName = isset($args[1]) ? $args[1] : basename($args[0]);

        return $this->exec('mount', 'mount', [$packageName, $projectName]);
    }
751389
protected function executeCommand($args)
    {
        $io = clone $this->io;

        $io->setArguments($args);
        $io->setOption('no-backup', true);
        $io->setOption('no-create-database', true);

//        foreach ($this->io->getOptions() as $k => $v)
//        {
//            $io->setOption($k, $v);
//        }

        return $this->console->getRootCommand()->setIO($io)->execute();
    }
639320
public function run(array $args)
    {
        $command = 'help';

        if(isset($args[1])) {
            $command = $args[1];
        }

        //cradle author/vendor action
        if(strpos($command, '/') !== false) {
            $command = 'package';
            array_splice($args, 1, 0, array($command));
        }

        $class = '\\Cradle\\CommandLine\\'.ucwords($command);

        if(!class_exists($class)) {
            //by default it's an event
            $class = '\\Cradle\\CommandLine\\Event';
            array_splice($args, 1, 0, array('event'));
        }

        array_shift($args);
        $runner = new $class($this->cwd);

        $results = $runner->run($args);

        print PHP_EOL;

        return $results;
    }
539939
public function run(array $args)
    {
        print PHP_EOL;

        $command = 'help';

        //as in 'eve generate'
        if(isset($args[1])) {
            $command = $args[1];
        }

        $class = '\\Eve\\Framework\\Cli\\'.ucwords($command);

        if(!class_exists($class)) {
            self::error('No such command `'.$command.'` found.');
        }

        array_shift($args);
        $runner = new $class($this->cwd);

        $results = $runner->run($args);

        print PHP_EOL;

        return $results;
    }