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

Changeset 10825


Ignore:
Timestamp:
Feb 23, 2009, 4:24:48 PM (12 years ago)
Author:
ebihara
Message:

r797@ebimayo: co3k | 2009-02-23 16:22:56 +0900
#3502:added ability to migrate plugins by openpne:migrate task


Location:
OpenPNE3/trunk/lib
Files:
2 edited

Legend:

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

    r10799 r10825  
    2121    $dispatcher = null,
    2222    $dbManager = null,
     23    $pluginInstance = null,
     24
    2325    $targetName = '',
    2426    $connectionName = '';
     
    5153      $this->targetName = $pluginName;
    5254      $directory = sfConfig::get('sf_plugins_dir').'/'.$pluginName.'/data/migrations';
     55
     56      $this->pluginInstance = opPlugin::getInstance($this->targetName);
    5357    }
    5458    else
     
    157161    {
    158162      $files = sfFinder::type('file')->name('*.php')->in($dir);
    159       $iterator = new CompareMigrateDirectoryVersionFilterIterator($files, str_replace('-dev', '', OPENPNE_VERSION));
     163      $iterator = new CompareMigrateDirectoryVersionFilterIterator($files, str_replace('-dev', '', $this->getVersion()));
    160164      foreach ($iterator as $file)
    161165      {
     
    174178    }
    175179  }
     180
     181  protected function getVersion()
     182  {
     183    if ($this->pluginInstance instanceof opPlugin)
     184    {
     185      return $this->pluginInstance->getVersion();
     186    }
     187
     188    return OPENPNE_VERSION;
     189  }
    176190}
    177191
  • OpenPNE3/trunk/lib/task/openpneMigrateTask.class.php

    r10799 r10825  
    4545
    4646    $databaseManager = new sfDatabaseManager($this->configuration);
    47     $migration = new opMigration($this->dispatcher, $databaseManager);
     47    $migration = new opMigration($this->dispatcher, $databaseManager, $arguments['name']);
    4848    $migration->migrate();
    4949  }
Note: See TracChangeset for help on using the changeset viewer.