/** * @param string $url * @param string $version */ public function handleDownload($url, $version) { $filename = $this->gameUpdater->download($url, $this->path, $version); if ($this->immediateUse) { $this->serverRepo->setExecutable($this->serverId, $filename); } $this->getPresenter()->flashMessage('Staženo.', 'success'); if ($this->getPresenter()->isAjax()) { $this->getPresenter()->redrawControl(); } else { $this->getPresenter()->redirect('this'); } }
/** * @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'); } }