Executes the cli/run file in order to run another script from within the CRON process

@param $path
@param string|null $output
160410
public static function execute($path, string $output = null){
    if ( $output ){
      exec(sprintf('php -f router.php %s > %s 2>&1 &', $path, $output));
    }
    else{
      exec(sprintf('php -f router.php %s > /dev/null 2>&1 &', $path));
    }
  }
556144
private function _runParse( $path = NULL )
    {
        $startLevels  = $this->_getRealLevel( $this->_rootPath );
        $endLevels    = $startLevels + $this->levels;
        $currentLevel = 0;

        if ( NULL !== $path )
        {
            $this->_dirs[ ] = $path;
        }

        do
        {
            $dir          = array_shift( $this->_dirs );
            $currentLevel = $this->_getRealLevel( $dir );

            if ( $currentLevel < $endLevels )
            {
                $this->_parse( $dir );
            }
        } while ( count( $this->_dirs ) > 0 );
    }
579121
public function run($path, Extension $extension = null)
    {
        $files = $this->getMigrationFiles($path);

        $ran = $this->repository->getRan($extension ? $extension->getId() : null);

        $migrations = array_diff($files, $ran);

        $this->runMigrationList($path, $migrations, $extension);
    }
972016
public function execute($path, array $args = [], array $envs = [])
    {
        if (false === @pcntl_exec($path, $args, $envs)) {
            throw new RuntimeException('Error when executing command');
        }
    }
1006842
public function execute($sourceId = null, $command = null)
    {
        $batch  = $this->getBatch();
        $params = array_slice(func_get_args(), 2);
        $source = $this->loader->getTracker()->getSource($sourceId);

        if ($messages = call_user_func_array(array($source, $command), $params)) {
            foreach ($messages as $message) {
                $batch->addMessage($command . ': ' . $message);
            }
        }
    }
827551
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $scheduler = new Runner();
    $schedule = new Kernel();
    $schedule->run($scheduler);

    // run application commands
    (new SystemScheduler)->run($scheduler);

    $this->autoload_plugins($scheduler);

    $scheduler->run();
  }
435500
protected function execute($command, $path)
    {
        $command = sprintf('%s "%s"', $command, $path);

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

        if ($return === 0 && is_array($output)) {
            return $output;
        }
    }
415281
public function runTransient(InputInterface $input=null,
        OutputInterface $output=null
    ) {
        foreach ($this->getEnvironmentMessages() as $message => $style) {
            $this->printLn($message, $style);
        }
    }
925945
def execute_in_dir(path, cmd)
      exit_status = 0
      Dir.chdir(path) do
        exit_status = run %( #{cmd} )
      end
      exit_status
    end
1344388
public function run($commands, Closure $callback = null)
    {
        // First, we will initialize the SSH gateway, and then format the commands so
        // they can be run. Once we have the commands formatted and the server is
        // ready to go we will just fire off these commands against the server.
        $gateway = $this->getGateway();

        $callback = $this->getCallback($callback);

        $gateway->run($this->formatCommands($commands));

        // After running the commands against the server, we will continue to ask for
        // the next line of output that is available, and write it them out using
        // our callback. Once we hit the end of output, we'll bail out of here.
        while (true) {
            if (is_null($line = $gateway->nextLine())) {
                break;
            }

            call_user_func($callback, $line, $this);
        }
    }
94350
public function execute($path = null)
    {
        $content = '';

        // loop files
        foreach ($this->data as $source => $js) {
            /*
             * Combine js: separating the scripts by a ;
             * I'm also adding a newline: it will be eaten when whitespace is
             * stripped, but we need to make sure we're not just appending
             * a new script right after a previous script that ended with a
             * singe-line comment on the last line (in which case it would also
             * be seen as part of that comment)
             */
            $content .= $js."\n;";
        }

        /*
         * Let's first take out strings, comments and regular expressions.
         * All of these can contain JS code-like characters, and we should make
         * sure any further magic ignores anything inside of these.
         *
         * Consider this example, where we should not strip any whitespace:
         * var str = "a   test";
         *
         * Comments will be removed altogether, strings and regular expressions
         * will be replaced by placeholder text, which we'll restore later.
         */
        $this->extractStrings('\'"`');
        $this->stripComments();
        $this->extractRegex();
        $content = $this->replace($content);

        $content = $this->propertyNotation($content);
        $content = $this->shortenBools($content);
        $content = $this->stripWhitespace($content);

        /*
         * Earlier, we extracted strings & regular expressions and replaced them
         * with placeholder text. This will restore them.
         */
        $content = $this->restoreExtractedData($content);

        return $content;
    }
845293
public function script($path, $options = array()) {
		$options = array_merge(array('block' => 'script'), $options);
		$this->_append('js', $path, $options);
	}
971152
public function runTransient(InputInterface $input=null,
        OutputInterface $output=null
    ) {
        $this->printLn("Vagrant Transient Version: ".$this->getVersion(), 'normal');
    }
1232179
private function executeCommand(Command $command, $path, array $options)
    {
        $oldCwd = getcwd();

        $this->logger->info('Execute command '.$command->getCommand().' from '.$path);

        if (!chdir($path)) {
            $this->logger->error('Cannot change directory to '.$path);

            return new CommandResult($command->getCommand(), array(), 1, $options);
        }

        exec($command->getCommand(), $out, $resultCode);
        $out = is_array($out) ? $out : array();

        $this->logger->info('Exit code =  '.$resultCode);
        if ($resultCode !== 0) {
            $this->logger->error('Cannot execute command '.$command->getCommand().' from '.$path);
        }

        chdir($oldCwd);

        return new CommandResult($command->getCommand(), $out, $resultCode, $options);
    }
1173071
public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        putenv('LINES='.$this->terminal->getHeight());
        putenv('COLUMNS='.$this->terminal->getWidth());

        if (null === $input) {
            $input = new ArgvInput();
        }

        if (null === $output) {
            $output = new ConsoleOutput();
        }

        $renderException = function ($e) use ($output) {
            if (!$e instanceof \Exception) {
                $e = class_exists(FatalThrowableError::class) ? new FatalThrowableError($e) : new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine());
            }
            if ($output instanceof ConsoleOutputInterface) {
                $this->renderException($e, $output->getErrorOutput());
            } else {
                $this->renderException($e, $output);
            }
        };
        if ($phpHandler = set_exception_handler($renderException)) {
            restore_exception_handler();
            if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) {
                $debugHandler = true;
            } elseif ($debugHandler = $phpHandler[0]->setExceptionHandler($renderException)) {
                $phpHandler[0]->setExceptionHandler($debugHandler);
            }
        }

        $this->configureIO($input, $output);

        try {
            $exitCode = $this->doRun($input, $output);
        } catch (\Exception $e) {
            if (!$this->catchExceptions) {
                throw $e;
            }

            $renderException($e);

            $exitCode = $e->getCode();
            if (is_numeric($exitCode)) {
                $exitCode = (int) $exitCode;
                if (0 === $exitCode) {
                    $exitCode = 1;
                }
            } else {
                $exitCode = 1;
            }
        } finally {
            // if the exception handler changed, keep it
            // otherwise, unregister $renderException
            if (!$phpHandler) {
                if (set_exception_handler($renderException) === $renderException) {
                    restore_exception_handler();
                }
                restore_exception_handler();
            } elseif (!$debugHandler) {
                $finalHandler = $phpHandler[0]->setExceptionHandler(null);
                if ($finalHandler !== $renderException) {
                    $phpHandler[0]->setExceptionHandler($finalHandler);
                }
            }
        }

        if ($this->autoExit) {
            if ($exitCode > 255) {
                $exitCode = 255;
            }

            exit($exitCode);
        }

        return $exitCode;
    }
710130
def _run_script(self, session, file_path):
        
        if file_path:
            # The 'run' command returns False in case of error
            # The 'execute' method returns False if the run command fails
            return self._shell.execute('run "{0}"'.format(file_path), session)

        return None
1047420
public function run($path, $data = null)
    {
        $model = array();

        /**
         * first we have get the correct path
         * of the module name and method to execute
         */
        $callPath = $this->route($path);

        /**
         * once we have the module name and the
         * method name we build the payload and
         * data array.
         */
        $payload = array(
            $this->modules[$callPath->module],
            $callPath->method
        );

        if (isset($data)) {
            foreach ($data as $key => $argument) {
                $model[$key] = $argument;
            }
        }

        /**
         * here finally perform the actual call
         * to the module method requested.
         */
        return call_user_func_array($payload, $model);
    }