/** * Union migrate manager constructor. * * @param null $plugin */ public function __construct($plugin = null) { if (Plugin::loaded($plugin)) { $this->_connectionConfig = ConnectionManager::config($this->_connectionName); $this->_adapterName = $this->_getAdapterName($this->_connectionConfig['driver']); $config = ['paths' => ['migrations' => UnionPlugin::migrationPath($plugin)], 'environments' => $this->_configuration()]; $this->_plugin = $plugin; $this->_config = new Config($config); $adapterOptions = $this->_config->getEnvironment($this->_connectionName); $this->_adapter = $this->_setAdapter($adapterOptions); } }
/** * Get migrations data from plugin migration folder. * * @return array */ public function getMigrations() { $migrationPath = UnionPlugin::migrationPath($this->getName()); return UnionPlugin::migrationData($migrationPath); }