Exemplo n.º 1
0
 /**
  * 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);
     }
 }
Exemplo n.º 2
0
 /**
  * Get migrations data from plugin migration folder.
  *
  * @return array
  */
 public function getMigrations()
 {
     $migrationPath = UnionPlugin::migrationPath($this->getName());
     return UnionPlugin::migrationData($migrationPath);
 }