Executes a command on the server and returns an array of string.

@param string $command Command to execute
@param string $target  First parameter
@param string $value   Second parameter

@return array The result of the command as an array of string
867
public function getStringArray($command, $target = null, $value = null)
    {
        $string = $this->getString($command, $target, $value);

        $results = preg_split('/(?<!\\\),/', $string);
        foreach ($results as &$result) {
            $result = str_replace('\,', ',', $result);
        }

        return $results;
    }
129371
protected function execute($command)
    {
        $status = null;
        $result = array();
        exec($command, $result, $status);
        return !$status ? $result : null;
    }
94018
protected function executeCommand($command)
    {
        $result = @exec($command, $output, $code);
        $output = implode("\n", $output);

        if ($result === false) {
            throw new Exception("Failed to execute command '$command' with message: [$code] '$output'");
        }

        return $output;
    }
844594
public static int execute(String command, String[] envVars, File dir, Receiver outputReceiver) throws IOException {
		return execute(getCommandArrayForCurrentOS(command), envVars, dir, outputReceiver);
	}
1120859
public function getTarget($command)
    {
        if (empty($this->routes[$command])) {
            return null;
        }

        /* @var $route Route */
        $route = $this->routes[$command];
        return $route->getTarget($this->args);
    }
618732
public function execute(interfaces\commands\Command $command)
    {
        $handler = $this->resolver->resolve($command);
        
        return call_user_func([$handler, 'handle'], $command);
    }
901734
public function process404($target, $commands)
    {
        if (file_exists($target)) {
            return;
        }
        
        $targetFolder = pathinfo($target, PATHINFO_DIRNAME);
        if (!file_exists($targetFolder)) {
            mkdir($targetFolder, 0777, true);
        }
        
        $text = 'Not found';
        $backgroundColor = null;
        $color = null;
        $width = null;
        $height = null;
        foreach ($this->analyseCommands($commands) as $command) {
            if ('thumb' === $command['command'] || 'resize' === $command['command']) {
                $width = $command['params'][0];
                $height = $command['params'][1];
                
            } elseif ('404' === $command['command']) {
                if (isset($command['params'][0]) && UrlSafeBase64::valid($command['params'][0])) {
                    $text = UrlSafeBase64::decode($command['params'][0]);
                }
                if (isset($command['params'][1])) {
                    $backgroundColor = $command['params'][1];
                }
                if (isset($command['params'][2])) {
                    $color = $command['params'][2];
                }
                if (isset($command['params'][3])) {
                    $width = $command['params'][3];
                }
                if (isset($command['params'][4])) {
                    $height = $command['params'][4];
                }
            }
        }
        $this->image404($text, $backgroundColor, $color, $width, $height);
        
        $this->image->save($target);
    }
1314540
public function execute(Command $command)
    {
        $this->log('Executing command [' . get_class($command) . ']', $command);

        try {
            $response = $this->innerCommandBus->execute($command);
        } catch (\Exception $e) {

            $message = 'Failed executing command [' . get_class($command) . ']. ' . $this->createExceptionString($e);
            $this->log($message, $command);
            throw $e;
        }

        $this->log('Successfully executed command [' . get_class($command) . ']', $command);

        return $response;
    }
335587
public function execute($command, $arguments = array())
    {
        $options = $this->getOptions();
        $consoleDir = $this->getConsoleDir();

        if (null === $consoleDir) {
            return;
        }

        $argumentString = '';

        foreach ($arguments as $argument) {
            $argumentString .= escapeshellarg($argument) . ' ';
        }

        $this->executeCommand($consoleDir, $command . ' ' . $argumentString);
    }
977055
protected function _execute($command) {
		try {
			if (!$class = $this->_instance($command)) {
				return false;
			}
		} catch (ClassNotFoundException $e) {
			return false;
		}
		$data = [];
		$params = $class->invokeMethod('_params');

		foreach ($params as $param) {
			$data[$param] = $class->invokeMethod("_{$param}", [$this->request]);
		}

		if ($message = $class->invokeMethod('_save', [$data])) {
			$this->out($message);
			return true;
		}
		return false;
	}
1075591
public function execute(Command $command)
    {
        $handler = $this->resolver->resolve($command);

        return $handler->handle($command);
    }
508665
protected function mapInputToCommand($command, $input)
    {
        if (is_object($command)) {
            return $command;
        }
        $dependencies = [];
        $class = new ReflectionClass($command);
        foreach ($class->getConstructor()->getParameters() as $parameter) {
            if ( $parameter->getPosition() == 0 && $parameter->isArray() ) {
                if ($input !== []) {
                    $dependencies[] = $input;
                } else {
                    $dependencies[] = $this->getDefaultValueOrFail($parameter);
                }
            } else {
                $name = $parameter->getName();
                if (array_key_exists($name, $input)) {
                    $dependencies[] = $input[$name];
                } else {
                    $dependencies[] = $this->getDefaultValueOrFail($parameter);
                }
            }
        }

        return $class->newInstanceArgs($dependencies);
    }
589525
protected function executeCommand()
    {
        $cmdl = $this->realCommand;

        $this->log('Executing command: ' . $cmdl, $this->logLevel);

        $output = [];
        $return = null;

        if ($this->passthru) {
            passthru($cmdl, $return);
        } else {
            exec($cmdl, $output, $return);
        }

        return [$return, $output];
    }
352305
public function handle(SubscribeSubscriberCommand $command)
    {
        if ($subscriber = Subscriber::where('email', '=', $command->email)->first()) {
            return $subscriber;
        }

        $subscriber = Subscriber::firstOrCreate(['email' => $command->email]);

        // Decide what to subscribe the subscriber to.
        if ($subscriptions = $command->subscriptions) {
            $components = Component::whereIn('id', $subscriptions)->get();
        } else {
            $components = Component::all();
        }

        $components->each(function ($component) use ($subscriber) {
            Subscription::create([
                'subscriber_id' => $subscriber->id,
                'component_id'  => $component->id,
            ]);
        });

        if ($command->verified) {
            execute(new VerifySubscriberCommand($subscriber));
        } else {
            $subscriber->notify(new VerifySubscriptionNotification());
        }

        event(new SubscriberHasSubscribedEvent($subscriber));

        $subscriber->load('subscriptions');

        return $subscriber;
    }
723587
public function execute(Command $command)
    {
        if (!$command->isValid()) {
            throw new Exception('Invalid API command supplied');
        }

        $result = $this->curl()->post($this->getUrl($command), $command->getData());
        $type = $this->getResponseType();

        return new Response($result->getData(), $type);
    }
435500
protected function execute($command, $path)
    {
        $command = sprintf('%s "%s"', $command, $path);

        exec($command, $output, $return);

        if ($return === 0 && is_array($output)) {
            return $output;
        }
    }
1311872
public static function execute($command, array $placeholders = [])
    {
        if (!empty($placeholders)) {
            $command = strtr($command, array_map('escapeshellarg', $placeholders));
        }
        $result = new ShellResult();
        $result->command = $command;
        exec($command . ' 2>&1', $result->outputLines, $result->exitCode);
        return $result;
    }