Changeset 11004
- Timestamp:
- Mar 12, 2009, 1:35:41 PM (10 years ago)
- Location:
- OpenPNE3/trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE3/trunk/lib/plugin/opPearRest.class.php
r10003 r11004 21 21 { 22 22 $content = parent::retrieveData($url, $accept, true, $channel); 23 $result = $this->parseXML($content); 24 return $result; 25 } 23 26 24 $result = $this->parseXML($content); 27 public function retrieveXml($url) 28 { 29 $content = $this->downloadHttp($url); 30 $result = @simplexml_load_string($content); 25 31 return $result; 26 32 } -
OpenPNE3/trunk/lib/plugin/opPluginManager.class.php
r10003 r11004 51 51 } 52 52 53 public function retrieveChannel Data($path)53 public function retrieveChannelXml($path) 54 54 { 55 55 $rest = $this->getEnvironment()->getRest(); 56 return $rest->_rest->retrieve Data($this->getBaseURL().$path);56 return $rest->_rest->retrieveXml($this->getBaseURL().$path); 57 57 } 58 58 59 59 public function getPluginInfo($plugin) 60 60 { 61 return $this->retrieveChannelData('p/'.strtolower($plugin).'/info.xml'); 61 $data = $this->retrieveChannelXml('p/'.strtolower($plugin).'/info.xml'); 62 $result = array_merge(array( 63 'n' => $plugin, 64 'c' => opPluginManager::OPENPNE_PLUGIN_CHANNEL, 65 'l' => 'Apache', 66 's' => $plugin, 67 'd' => $plugin, 68 ), (array)$data); 69 70 return $result; 62 71 } 63 72 64 73 public function getPluginMaintainer($plugin) 65 74 { 66 return $this->retrieveChannelData('p/'.strtolower($plugin).'/maintainers.xml');67 }75 $data = $this->retrieveChannelXml('p/'.strtolower($plugin).'/maintainers2.xml'); 76 $result = array(); 68 77 69 public function getMaintainerInfo($maintainer) 70 { 71 return $this->retrieveChannelData('m/'.strtolower($maintainer).'/info.xml'); 78 foreach ($data->m as $maintainer) 79 { 80 $info = $this->retrieveChannelXml('m/'.strtolower((string)$maintainer->h).'/info.xml'); 81 $result[] = array_merge((array)$maintainer, array('n' => (string)$info->n)); 82 } 83 84 return $result; 72 85 } 73 86 -
OpenPNE3/trunk/lib/task/opPluginDefineTask.class.php
r10683 r11004 22 22 new sfCommandArgument('stability', sfCommandArgument::REQUIRED, 'The plugin stability'), 23 23 new sfCommandArgument('note', sfCommandArgument::REQUIRED, 'The plugin release note'), 24 new sfCommandArgument('user', sfCommandArgument::REQUIRED, 'Your username'),25 24 )); 26 25 … … 52 51 } 53 52 54 $user = $this->getPluginManager()->getMaintainerInfo($arguments['user']);55 if (!$user)56 {57 throw new sfCommandException('Your account has not registerd yet.');58 }59 60 53 $packageXml = new PEAR_PackageFileManager2(); 61 54 $options = array( … … 74 67 $packageXml->_options['roles'] = array('*' => 'data'); 75 68 69 $maintainers = $this->getPluginManager()->getPluginMaintainer($pluginName); 70 foreach ($maintainers as $maintainer) 71 { 72 $packageXml->addMaintainer($maintainer['r'], $maintainer['h'], $maintainer['n'], ''); 73 } 74 76 75 $packageXml->setPackage($pluginName); 77 76 $packageXml->setChannel(opPluginManager::OPENPNE_PLUGIN_CHANNEL); … … 80 79 $packageXml->setApiVersion($arguments['version']); 81 80 $packageXml->setApiStability($arguments['stability']); 82 $packageXml->addMaintainer('lead', $user['h'], $user['n'], '');83 81 $packageXml->setNotes($arguments['note']); 84 82 $packageXml->setPhpDep('5.2.3'); -
OpenPNE3/trunk/lib/task/opPluginReleaseTask.class.php
r10683 r11004 52 52 while (!($note = $this->ask('Type release note'))); 53 53 54 while (!($user = $this->ask('Type your account')));55 56 54 $this->logBlock('These informations are inputed:', 'COMMENT'); 57 55 $this->log($this->formatList(array( … … 60 58 'The Plugin Stability' => $stability, 61 59 'The Release note ' => $note, 62 'Your account ' => $user,63 60 ))); 64 61 65 62 if ($this->askConfirmation('Is it OK to start this task? (y/n)')) 66 63 { 67 $this->doRelease($name, $version, $stability, $note, $dir , $user);64 $this->doRelease($name, $version, $stability, $note, $dir); 68 65 $this->clearCache(); 69 66 } 70 67 } 71 68 72 protected function doRelease($name, $version, $stability, $note, $dir , $user)69 protected function doRelease($name, $version, $stability, $note, $dir) 73 70 { 74 71 $defineTask = new opPluginDefineTask($this->dispatcher, $this->formatter); 75 $defineTask->run(array('name' => $name, 'version' => $version, 'stability' => $stability, 'note' => '"'.$note.'"' , 'user' => $user));72 $defineTask->run(array('name' => $name, 'version' => $version, 'stability' => $stability, 'note' => '"'.$note.'"')); 76 73 $archiveTask = new opPluginArchiveTask($this->dispatcher, $this->formatter); 77 74 $archiveTask->run(array('name' => $name, $dir));
Note: See TracChangeset
for help on using the changeset viewer.