REBELinBLUE\Deployer\ServerLog::runtime PHP Method

runtime() public method

Calculates how long the commands were running on the server for.
public runtime ( ) : false | integer
return false | integer Returns false if the command has not yet finished or the runtime in seconds
    public function runtime()
    {
        if (!$this->finished_at) {
            return false;
        }
        return $this->started_at->diffInSeconds($this->finished_at);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * ServerLogChanged constructor.
  *
  * @param ServerLog $log
  */
 public function __construct(ServerLog $log)
 {
     $this->status = $log->status;
     $this->started_at = $log->started_at ? $log->started_at->toDateTimeString() : null;
     $this->finished_at = $log->finished_at ? $log->finished_at->toDateTimeString() : null;
     $this->log_id = $log->id;
     $this->output = is_null($log->output) || !strlen($log->output) ? null : '';
     $this->runtime = $log->runtime() === false ? null : $log->getPresenter()->readable_runtime;
 }
All Usage Examples Of REBELinBLUE\Deployer\ServerLog::runtime