Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 9 |
AbstractPluginManager | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 9 |
migrationSchema | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 9 |
<?php | |
namespace Eccube\Plugin; | |
use Doctrine\DBAL\Migrations\Migration; | |
use Doctrine\DBAL\Migrations\Configuration\Configuration; | |
class AbstractPluginManager { | |
CONST MIGRATION_TABLE_PREFIX = 'migration_'; | |
public function migrationSchema($app,$migrationFilePath,$pluginCode,$version=null) | |
{ | |
$config = new Configuration($app['db']); | |
$config->setMigrationsNamespace('DoctrineMigrations'); | |
$config->setMigrationsDirectory($migrationFilePath); | |
$config->registerMigrationsFromDirectory($migrationFilePath ); | |
$config->setMigrationsTableName(self::MIGRATION_TABLE_PREFIX.$pluginCode); | |
$migration = new Migration($config); | |
// null 又は 'last' を渡すと最新バージョンまでマイグレートする | |
// 0か'first'を渡すと最初に戻る | |
$migration->migrate($version, false); | |
} | |
} |