Ejemplo n.º 1
0
 public function testMergeOrderInSameFileOverrides()
 {
     $xml = '<?xml version="1.0" ?>
             <slimdump>
                 <table name="test" dump="noblob" />
                 <table name="xxx" dump="full" />
                 <table name="test" dump="full" />
             </slimdump>';
     $config = ConfigBuilder::createFromXmlString($xml);
     $table = $config->findTable('test');
     $this->assertNotEquals('NULL', $table->getSelectExpression('testColumnName', true));
 }
Ejemplo n.º 2
0
 public function __construct(ConfigBuilder $builder)
 {
     $this->stopWords = $builder->getStopWords();
     $this->index = $builder->getIndex();
     $this->store = $builder->getStore();
     $this->tokenizer = $builder->getTokenizer();
     $this->ranker = $builder->getRanker();
 }
 /**
  * @param array $config
  * @return Config
  */
 public function makeConfigFromArray(array $config)
 {
     $configBuilder = new ConfigBuilder();
     foreach ($config as $k => $v) {
         if ('user' === $k) {
             $configBuilder->withUser($v);
         }
         if ('ip' === $k || 'host' === $k) {
             $configBuilder->withHost($v);
         }
         if ('port' === $k) {
             $configBuilder->withPort($v);
         }
         if ('password' === $k) {
             $configBuilder->withPassword($v);
         }
         if ('charset' === $k) {
             $configBuilder->withCharset($v);
         }
         if ('gtid' === $k) {
             $configBuilder->withGtid($v);
         }
         if ('slaveId' === $k) {
             $configBuilder->withSlaveId($v);
         }
         if ('binLogFileName' === $k) {
             $configBuilder->withBinLogFileName($v);
         }
         if ('binLogPosition' === $k) {
             $configBuilder->withBinLogPosition($v);
         }
         if ('eventsOnly' === $k) {
             $configBuilder->withEventsOnly($v);
         }
         if ('eventsIgnore' === $k) {
             $configBuilder->withEventsIgnore($v);
         }
         if ('tablesOnly' === $k) {
             $configBuilder->withTablesOnly($v);
         }
         if ('databasesOnly' === $k) {
             $configBuilder->withDatabasesOnly($v);
         }
         if ('mariaDbGtid' === $k) {
             $configBuilder->withMariaDbGtid($v);
         }
         if ('tableCacheSize' === $k) {
             $configBuilder->withTableCacheSize($v);
         }
     }
     return $configBuilder->build();
 }
Ejemplo n.º 4
0
<?php

/**
 * This is the bootstrap file for test application.
 * This file should be removed when the application is deployed for production.
 */
$yii = __DIR__ . '/../app/vendor/yiisoft/yii/framework/yii.php';
$global = __DIR__ . '/../app/helpers/global.php';
$builder = __DIR__ . '/../app/vendor/crisu83/yii-configbuilder/helpers/ConfigBuilder.php';
defined('YII_DEBUG') or define('YII_DEBUG', true);
require_once $yii;
require_once $global;
require_once $builder;
$config = ConfigBuilder::build(array(__DIR__ . '/../app/config/main.php', __DIR__ . '/../app/config/test.php'));
Yii::createWebApplication($config)->run();
Ejemplo n.º 5
0
<?php

$yii = __DIR__ . '/../vendor/yiisoft/yii/framework/yii.php';
$builder = __DIR__ . '/../vendor/crisu83/yii-configbuilder/helpers/ConfigBuilder.php';
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('YII_DEBUG') or define('YII_DEBUG', true);
require_once $yii;
require_once $builder;
$config = ConfigBuilder::build(array(__DIR__ . '/config/main.php', __DIR__ . '/config/console.php'));
$app = Yii::createConsoleApplication($config);
$app->commandRunner->addCommands(YII_PATH . '/cli/commands');
$app->run();
Ejemplo n.º 6
0
<?php

date_default_timezone_set('UTC');
$debugger = __DIR__ . '/../vendor/crisu83/yii-debug/helpers/Debugger.php';
require_once $debugger;
Debugger::init(__DIR__ . '/../app/runtime/debug');
$yii = __DIR__ . '/../vendor/yiisoft/yii/framework/yii.php';
$global = __DIR__ . '/../app/helpers/global.php';
$builder = __DIR__ . '/../vendor/crisu83/yii-configbuilder/helpers/ConfigBuilder.php';
require_once $yii;
require_once $global;
require_once $builder;
$config = ConfigBuilder::buildForEnv(array(__DIR__ . '/../app/config/main.php', __DIR__ . '/../app/config/web.php', __DIR__ . '/../app/config/environments/{environment}.php', __DIR__ . '/../app/config/local.php'), __DIR__ . '/../app/runtime/environment');
Yii::createWebApplication($config)->run();