public function php($script, $bin = null, $args = [], $id = null)
    {
        if (! is_string($script)) {
            throw new InvalidArgumentException('The script should be a valid path to a file.');
        }

        $bin = $bin !== null && is_string($bin) && file_exists($bin) ?
            $bin : (PHP_BINARY === '' ? '/usr/bin/php' : PHP_BINARY);

        $job = new Job($bin . ' ' . $script, $args, $id);

        if (! file_exists($script)) {
            $this->pushFailedJob(
                $job,
                new InvalidArgumentException('The script should be a valid path to a file.')
            );
        }

        $this->queueJob($job->configure($this->config));

        return $job;
    }
public function php($script, $bin = null, $args = [], $id = null)
    {
        if (! is_string($script)) {
            throw new InvalidArgumentException('The script should be a valid path to a file.');
        }

        $bin = $bin !== null && is_string($bin) && file_exists($bin) ?
            $bin : (PHP_BINARY === '' ? '/usr/bin/php' : PHP_BINARY);

        $job = new Job($bin . ' ' . $script, $args, $id);

        if (! file_exists($script)) {
            $this->pushFailedJob(
                $job,
                new InvalidArgumentException('The script should be a valid path to a file.')
            );
        }

        $this->queueJob($job->configure($this->config));

        return $job;
    }
public function php ( $ script , $ bin = null , $ args = [ ] , $ id = null ) { if ( ! is_string ( $ script ) ) { throw new InvalidArgumentException ( 'The script should be a valid path to a file.' ) ; } $ bin = $ bin !== null && is_string ( $ bin ) && file_exists ( $ bin ) ? $ bin : ( PHP_BINARY === '' ? '/usr/bin/php' : PHP_BINARY ) ; $ job = new Job ( $ bin . ' ' . $ script , $ args , $ id ) ; if ( ! file_exists ( $ script ) ) { $ this -> pushFailedJob ( $ job , new InvalidArgumentException ( 'The script should be a valid path to a file.' ) ) ; } $ this -> queueJob ( $ job -> configure ( $ this -> config ) ) ; return $ job ; }
Queues a php script execution.

@param  string  $script  The path to the php script to execute
@param  string  $bin     Optional path to the php binary
@param  array  $args     Optional arguments to pass to the php script
@param  string  $id      Optional custom identifier
@return Job
Queues a php script execution .