public function executeReleaseDelete(sfWebRequest $request) { $request->checkCSRFProtection(); $this->release->delete(); $path = opPluginChannelServerToolkit::getFilePathToCache($this->release->Package->name, $this->release->version); @unlink($path); $this->getUser()->setFlash('notice', 'The release is removed successfully.'); $this->redirect('package_home', $this->release->Package); }
public function executeDownloadTgz(sfWebRequest $request) { $version = $request['version']; $this->package = $this->getRoute()->getObject(); $this->release = Doctrine::getTable('PluginRelease')->findOneByPackageIdAndVersion($this->package->id, $version); $this->forward404Unless($this->release); $bin = $this->release->File->FileBin->bin; $path = opPluginChannelServerToolkit::getFilePathToCache($this->package->name, $version); @file_put_contents($path, $bin); @chmod($path, 0777); header('Content-type: ' . $this->release->File->type); echo $bin; exit; }