예제 #1
0
 public function __construct($envParams, $kmigpath, $integId)
 {
     foreach ($envParams as $k => $v) {
         putenv($k . '=' . $v);
     }
     $container = array();
     if (file_exists($kmigpath . '/phpmig.php')) {
         $this->_hasPhpmig = true;
         require $kmigpath . '/phpmig.php';
         if (empty($container)) {
             throw new Exception('invalid container, make sure the relevant phpmig.php file sets a $container variable');
         }
         $this->_container = $container;
         $datafilename = KmsCi_Kmig_IntegrationHelper::getInstanceByIntegrationId($integId)->getKmigPhpmigDataFileName();
         if (file_Exists($datafilename)) {
             $this->_hasKmigData = true;
             \Kmig\Helper\Phpmig\KmigAdapter::setContainerValuesFromDataFile($this->_container, $datafilename);
         }
         $this->_command = new KmsCi_Environment_PhpmigHelper_Command();
         $this->_command->kmig_container = $this->_container;
         $this->_allMigrations = $this->_command->kmig_getMigrations();
         /** @var \Kmig\Helper\Phpmig\KmigAdapter $adapter */
         $adapter = $this->_container['phpmig.adapter'];
         $this->_allVersions = $adapter->fetchAll();
     }
 }
예제 #2
0
<?php

// change this to point to your vendor autoload file
// or do any other autoloading you require in your migrations
require_once __DIR__ . '/../../../vendor/autoload.php';
// also, remember to autoload your kaltura library - you can use kmig's library if you want
require_once __DIR__ . '/../../../vendor/kaltura/kmig/lib/Kaltura/autoload.php';
$container = KmsCi_Kmig_IntegrationHelper::getInstanceByIntegrationId('migrations2')->bootstrapContainer();
return $container;