public function start($pid_file = NULL, $log_file = '/dev/null')
	{
		if ($pid_file)
		{
			$this->_pid_file = $pid_file;
			if (is_file($this->_pid_file))
			{
				Phantomjs::kill(file_get_contents($pid_file));
				unlink($this->_pid_file);
			}
		}

		$this->_pid = Phantomjs::start('phantom.js', $this->port(), 'phantomjs-connection.js', $log_file);

		if ($this->_pid_file)
		{
			file_put_contents($this->_pid_file, $this->_pid);
		}

		$self = $this;

		return Attempt::make(function() use ($self) {
			return $self->is_running();
		});
	}
public function start($pid_file = NULL, $log_file = '/dev/null')
	{
		if ($pid_file)
		{
			$this->_pid_file = $pid_file;
			if (is_file($this->_pid_file))
			{
				Phantomjs::kill(file_get_contents($pid_file));
				unlink($this->_pid_file);
			}
		}

		$this->_pid = Phantomjs::start('phantom.js', $this->port(), 'phantomjs-connection.js', $log_file);

		if ($this->_pid_file)
		{
			file_put_contents($this->_pid_file, $this->_pid);
		}

		$self = $this;

		return Attempt::make(function() use ($self) {
			return $self->is_running();
		});
	}
public function start ( $ pid_file = NULL , $ log_file = '/dev/null' ) { if ( $ pid_file ) { $ this -> _pid_file = $ pid_file ; if ( is_file ( $ this -> _pid_file ) ) { Phantomjs :: kill ( file_get_contents ( $ pid_file ) ) ; unlink ( $ this -> _pid_file ) ; } } $ this -> _pid = Phantomjs :: start ( 'phantom.js' , $ this -> port ( ) , 'phantomjs-connection.js' , $ log_file ) ; if ( $ this -> _pid_file ) { file_put_contents ( $ this -> _pid_file , $ this -> _pid ) ; } $ self = $ this ; return Attempt :: make ( function ( ) use ( $ self ) { return $ self -> is_running ( ) ; } ) ; }
Start a new phantomjs server, optionally provide pid_file and log file.
If you provide a pid_file, it will kill the process currently running on that pid, before starting the new one
If the start is unsuccessfull it will return FALSE
@param  string $pid_file
@param  string $log_file
@return boolean
Start a new phantomjs server optionally provide pid_file and log file . If you provide a pid_file it will kill the process currently running on that pid before starting the new one If the start is unsuccessfull it will return FALSE