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

Changeset 11257


Ignore:
Timestamp:
Apr 9, 2009, 5:40:46 PM (12 years ago)
Author:
ShogoKawahara
Message:

#3754:fixed opPlugin doesn't migrate correctly

Location:
OpenPNE3/trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/migration/opMigration.class.php

    r10856 r11257  
    106106    {
    107107      $this->targetName = $name;
    108       $this->pluginInstance = opPlugin::getInstance($this->targetName);
     108      $this->pluginInstance = opPlugin::getInstance($this->targetName, $this->dispatcher);
    109109    }
    110110    else
  • OpenPNE3/trunk/lib/plugin/opPlugin.class.php

    r10755 r11257  
    2626    $summary;
    2727
    28   private function __construct($pluginName)
     28  private function __construct($pluginName, sfEventDispatcher $dispatcher)
    2929  {
    3030    $this->name = $pluginName;
     
    4444    else
    4545    {
    46       $manager = new opPluginManager(sfContext::getInstance()->getEventDispatcher());
     46      $manager = new opPluginManager($dispatcher);
    4747      $package = $manager->getEnvironment()->getRegistry()->getPackage($pluginName, opPluginManager::OPENPNE_PLUGIN_CHANNEL);
    4848      if ($package)
     
    5454  }
    5555
    56   public static function getInstance($pluginName)
     56  public static function getInstance($pluginName, sfEventDispatcher $dispatcher = null)
    5757  {
     58    if (is_null($dispatcher))
     59    {
     60      $dispatcher = sfContext::getInstance()->getEventDispatcher();
     61    }
     62
    5863    if (empty(self::$instances[$pluginName]))
    5964    {
    60       self::$instances[$pluginName] = new opPlugin($pluginName);
     65      self::$instances[$pluginName] = new opPlugin($pluginName, $dispatcher);
    6166    }
    6267
Note: See TracChangeset for help on using the changeset viewer.