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

Changeset 10313


Ignore:
Timestamp:
Jan 22, 2009, 4:50:21 PM (11 years ago)
Author:
ebihara
Message:

#3198:added an update script for executing the update files of the bandled plugins

Location:
OpenPNE3/trunk/lib
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/lib/task/openpneUpdateTask.class.php

    r10305 r10313  
    2020      new sfCommandArgument('before-version', sfCommandArgument::REQUIRED, ''),
    2121      new sfCommandArgument('after-version', sfCommandArgument::REQUIRED, ''),
     22    ));
     23
     24    $this->addOptions(array(
     25      new sfCommandOption('no-build-model', null, sfCommandOption::PARAMETER_NONE, 'Do not build model classes'),
    2226    ));
    2327
     
    6064        $this->logSection('execute', $className);
    6165        require_once $dir.'/'.$file;
    62         $obj = new $className($databaseManager);
     66        $obj = new $className($this->dispatcher, $databaseManager);
    6367        $obj->doUpdate();
    6468      }
    6569    }
    6670
    67     $this->buildModel();
     71    if ($options['no-build-model'])
     72    {
     73      $this->buildModel();
     74    }
    6875  }
    6976
  • OpenPNE3/trunk/lib/update/opUpdate.class.php

    r10312 r10313  
    1919{
    2020  protected
     21    $dispatcher = null,
     22    $formatter = null,
    2123    $dbManager = null,
    2224    $database = null,
     
    2426    $doctrineProcess = null;
    2527
    26   public function __construct($dbManager, $name = '')
     28  public function __construct($dispatcher, $dbManager, $name = '')
    2729  {
     30    $this->dispatcher = $dispatcher;
     31
    2832    $this->dbManager = $dbManager;
    2933    if (!$name)
     
    4044    $this->connection = $doctrine->getDoctrineConnection();
    4145    $this->doctrineProcess = new opUpdateDoctrineMigrationProcess($this->connection);
     46
     47
     48    $this->formatter = new sfFormatter();
     49    if ('cli' === PHP_SAPI)
     50    {
     51      $this->formatter = new sfAnsiColorFormatter();
     52    }
     53
    4254  }
    4355
Note: See TracChangeset for help on using the changeset viewer.