ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 11004


Ignore:
Timestamp:
Mar 12, 2009, 1:35:41 PM (10 years ago)
Author:
ebihara
Message:

#3720:added support for developing plugins by multiple maintainers

Location:
OpenPNE3/trunk/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/plugin/opPearRest.class.php

    r10003 r11004  
    2121  {
    2222    $content = parent::retrieveData($url, $accept, true, $channel);
     23    $result = $this->parseXML($content);
     24    return $result;
     25  }
    2326
    24     $result = $this->parseXML($content);
     27  public function retrieveXml($url)
     28  {
     29    $content = $this->downloadHttp($url);
     30    $result = @simplexml_load_string($content);
    2531    return $result;
    2632  }
  • OpenPNE3/trunk/lib/plugin/opPluginManager.class.php

    r10003 r11004  
    5151  }
    5252
    53   public function retrieveChannelData($path)
     53  public function retrieveChannelXml($path)
    5454  {
    5555    $rest = $this->getEnvironment()->getRest();
    56     return $rest->_rest->retrieveData($this->getBaseURL().$path);
     56    return $rest->_rest->retrieveXml($this->getBaseURL().$path);
    5757  }
    5858
    5959  public function getPluginInfo($plugin)
    6060  {
    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;
    6271  }
    6372
    6473  public function getPluginMaintainer($plugin)
    6574  {
    66     return $this->retrieveChannelData('p/'.strtolower($plugin).'/maintainers.xml');
    67   }
     75    $data = $this->retrieveChannelXml('p/'.strtolower($plugin).'/maintainers2.xml');
     76    $result = array();
    6877
    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;
    7285  }
    7386
  • OpenPNE3/trunk/lib/task/opPluginDefineTask.class.php

    r10683 r11004  
    2222      new sfCommandArgument('stability', sfCommandArgument::REQUIRED, 'The plugin stability'),
    2323      new sfCommandArgument('note', sfCommandArgument::REQUIRED, 'The plugin release note'),
    24       new sfCommandArgument('user', sfCommandArgument::REQUIRED, 'Your username'),
    2524    ));
    2625
     
    5251    }
    5352
    54     $user = $this->getPluginManager()->getMaintainerInfo($arguments['user']);
    55     if (!$user)
    56     {
    57       throw new sfCommandException('Your account has not registerd yet.');
    58     }
    59 
    6053    $packageXml = new PEAR_PackageFileManager2();
    6154    $options = array(
     
    7467    $packageXml->_options['roles'] = array('*' => 'data');
    7568
     69    $maintainers = $this->getPluginManager()->getPluginMaintainer($pluginName);
     70    foreach ($maintainers as $maintainer)
     71    {
     72      $packageXml->addMaintainer($maintainer['r'], $maintainer['h'], $maintainer['n'], '');
     73    }
     74
    7675    $packageXml->setPackage($pluginName);
    7776    $packageXml->setChannel(opPluginManager::OPENPNE_PLUGIN_CHANNEL);
     
    8079    $packageXml->setApiVersion($arguments['version']);
    8180    $packageXml->setApiStability($arguments['stability']);
    82     $packageXml->addMaintainer('lead', $user['h'], $user['n'], '');
    8381    $packageXml->setNotes($arguments['note']);
    8482    $packageXml->setPhpDep('5.2.3');
  • OpenPNE3/trunk/lib/task/opPluginReleaseTask.class.php

    r10683 r11004  
    5252    while (!($note = $this->ask('Type release note')));
    5353
    54     while (!($user = $this->ask('Type your account')));
    55 
    5654    $this->logBlock('These informations are inputed:', 'COMMENT');
    5755    $this->log($this->formatList(array(
     
    6058      'The Plugin Stability' => $stability,
    6159      'The Release note    ' => $note,
    62       'Your account        ' => $user,
    6360    )));
    6461
    6562    if ($this->askConfirmation('Is it OK to start this task? (y/n)'))
    6663    {
    67       $this->doRelease($name, $version, $stability, $note, $dir, $user);
     64      $this->doRelease($name, $version, $stability, $note, $dir);
    6865      $this->clearCache();
    6966    }
    7067  }
    7168
    72   protected function doRelease($name, $version, $stability, $note, $dir, $user)
     69  protected function doRelease($name, $version, $stability, $note, $dir)
    7370  {
    7471    $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.'"'));
    7673    $archiveTask = new opPluginArchiveTask($this->dispatcher, $this->formatter);
    7774    $archiveTask->run(array('name' => $name, $dir));
Note: See TracChangeset for help on using the changeset viewer.