示例#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
 public function setup()
 {
     $this->_runner->getUtilHelper()->softUnlink($this->getIntegrationPath() . '/.kmig.phpmig.data');
     if (parent::setup() && KmsCi_Kmig_IntegrationHelper::getInstance($this)->setup()) {
         return true;
     } else {
         return false;
     }
 }
示例#3
0
 public function testDummy()
 {
     $kmigHelper = KmsCi_Kmig_IntegrationHelper::getInstance($this);
     $mEntry = $kmigHelper->getMigrator()->entry->get('test123');
     $kEntry = $kmigHelper->getClient()->baseEntry->get($mEntry->id);
     if ($mEntry->name == 'test123' && $kEntry->name == 'test123') {
         echo "OK\n";
         return true;
     } else {
         echo "FAILED\n";
         return false;
     }
 }
 /**
  * @param $integration
  * @return KmsCi_Kmig_IntegrationHelper
  */
 protected function _getIntegrationHelper($integration)
 {
     return KmsCi_Kmig_IntegrationHelper::getInstance($integration);
 }
示例#5
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;
 public static function getInstanceByIntegrationId($integId)
 {
     $runner = KmsCi_Bootstrap::getRunner();
     $className = KmsCi_Runner_IntegrationTests::getIntegrationClassById($integId, $runner);
     $integration = new $className($runner, $integId);
     return KmsCi_Kmig_IntegrationHelper::getInstance($integration);
 }