public function __construct($localFile = null, $remoteFile = null, $serverGroup = null, $timeout = null) { if ($localFile) { $this->setLocalFile($localFile); } if ($remoteFile) { $this->setRemoteFile($remoteFile); } parent::__construct($serverGroup, $timeout); }
public function __construct($name, callable $callback, $serverGroup = null, $timeout = null) { $this->setName($name); $this->setCallback($callback); parent::__construct($serverGroup, $timeout); }
public function __construct($command, $serverGroup = null, $timeout = null) { $this->setCommand($command); parent::__construct($serverGroup, $timeout); }
/** * Add task for executing on server * * @access public * @param AbstractTask $task * @return Dplr */ public function addTask(AbstractTask $task) { if ($group = $task->getServerGroup()) { $contain = false; foreach ($this->servers as $serverName => $groups) { if (in_array($group, $groups)) { $contain = true; } } if (!$contain) { throw new \RuntimeException(sprintf('Server group "%s" not defined in current session.', $group)); } } $task->setDplr($this); $this->tasks[] = $task; return $this; }