public function uploadPackage()
 {
     $tgz = $this->getValue('tgz_file');
     $svn = $this->getValue('svn_url');
     $gitUrl = $this->getValue('git_url');
     $gitCommit = $this->getValue('git_commit');
     $memberId = sfContext::getInstance()->getUser()->getMemberId();
     $pear = opPluginChannelServerToolkit::registerPearChannel($this->getChannel());
     if ($tgz) {
         require_once 'Archive/Tar.php';
         $info = $pear->infoFromTgzFile($tgz->getTempName());
         if ($info instanceof PEAR_Error) {
             throw new RuntimeException($info->getMessage());
         }
         $tar = new Archive_Tar($tgz->getTempName());
         $xml = '';
         foreach ($tar->listContent() as $file) {
             if ('package.xml' === $file['filename']) {
                 $xml = $tar->extractInString($file['filename']);
             }
         }
         $file = new File();
         $file->setFromValidatedFile($tgz);
         $file->save();
         $this->uploadToS3($file);
         $release = Doctrine::getTable('PluginRelease')->createByPackageInfo($info, $file, $memberId, $xml);
         $this->package->PluginRelease[] = $release;
         $this->package->save();
     } elseif ($svn) {
         $dir = $this->importFromSvn($svn);
         $this->importSCMFile($pear, $memberId, $dir);
     } elseif ($gitUrl && $gitCommit) {
         $dir = $this->importFromGit($gitUrl, $gitCommit);
         $this->importSCMFile($pear, $memberId, $dir);
     }
 }
 public function executeRelease(sfWebRequest $request)
 {
     foreach (array('channel_name', 'summary', 'suggestedalias') as $v) {
         $this->{$v} = opPluginChannelServerToolkit::getConfig($v, str_replace(':80', '', $this->getRequest()->getHost()));
     }
     $baseUrl = 'http://' . $this->channel_name . 'pluginRest/';
     $channel = opPluginChannelServerToolkit::generatePearChannelFile($this->channel_name, $this->summary, $this->suggestedalias, $baseUrl);
     $this->pear = opPluginChannelServerToolkit::registerPearChannel($channel);
     $this->info = $this->pear->infoFromString($this->release->package_definition);
     $this->form = new BaseForm();
 }