/** * Constructor */ public function __construct($dispatcher, $dbManager, $targetName = '', $connectionName = '') { $this->migrationBase = new opMigrationBase(); $this->dispatcher = $dispatcher; $this->dbManager = $dbManager; $this->setConnectionName($connectionName); $this->database = $this->dbManager->getDatabase($this->connectionName); $this->initializeDatabaseConfiguration(); $this->setTargetName($targetName); $this->setFormatter(); return parent::__construct($this->getMigrationScriptDirectory()); }
/** * Constructor */ public function __construct($dispatcher, $dbManager, $targetName = '', $connectionName = '', $params = array()) { $this->migrationBase = new opMigrationBase(); $this->dispatcher = $dispatcher; $this->dbManager = $dbManager; $this->setConnectionName($connectionName); $this->database = $this->dbManager->getDatabase($this->connectionName); $this->initializeDatabaseConfiguration(); $this->setTargetName($targetName); if (isset($params['revision'])) { $this->revision = $params['revision']; } elseif (isset($params['version'])) { $this->version = $params['version']; $this->revision = (string) $this->getRevisionByVersion($this->getVersion(), $this->getMigrationScriptDirectory()); } $this->setFormatter(); return parent::__construct($this->getMigrationScriptDirectory()); }