Ejemplo n.º 1
0
 /**
  * Backup world/ folder. Provide runtime hash when you want to save running server
  * @param string $path path to folder with minecraft
  * @param string $runtimeHash
  * @return boolean
  */
 public function backup($path, $runtimeHash = NULL)
 {
     $date = new Nette\DateTime();
     $filename = $date->format('Y-m-d_H-i');
     $oldumask = umask(0);
     @mkdir($path . 'backups/', 0771);
     umask($oldumask);
     if ($this->serverCmd->isServerRunning($runtimeHash)) {
         return $this->backupRunning($path, $runtimeHash, $filename);
     } else {
         return $this->backupSwitchedOff($path, $filename);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param string $filename
  */
 public function handleUseFile($filename)
 {
     if ($this->serverCmd->isServerRunning($this->runtimeHash)) {
         $this->serverCmd->stopServer($this->runtimeHash);
         $this->flashMessage('Server byl vypnut.', 'info');
     }
     $this->serverRepo->setExecutable($this->selectedServerId, $filename);
     $this->flashMessage('Verze nastavena úspěšně.', 'success');
     if ($this->isAjax()) {
         $this->redrawControl();
         $this->redrawControl('runIcon');
     } else {
         $this->redirect('this');
     }
 }