Exemple #1
0
 public function testFabric()
 {
     $this->assertTrue(is_string(Fabric::hostedPrivatePlatform(true)));
 }
Exemple #2
0
 * Load up the database configuration, free edition, private hosted, or others.
 * Look for non-default database config to override.
 */
if (false === ($_dbConfig = Pii::includeIfExists(__DIR__ . DATABASE_CONFIG_PATH, true))) {
    if (Fabric::fabricHosted()) {
        $_fabricHosted = true;
        list($_dbConfig, $_metadata) = Fabric::initialize();
    } else {
        /**
         * Database names vary by type of DSP:
         *
         *        1. Free Edition/Hosted:   DSP name
         *        2. Hosted Private:        hpp_<DSP Name>
         *        3. All others:            dreamfactory or whatever is in non-default config.
         */
        if (false !== ($_host = Fabric::hostedPrivatePlatform(true))) {
            $_dbName = 'hpp_' . str_ireplace(array('.dreamfactory.com', '-', '.cloud', '.'), array(null, '_', null, '_'), $_host);
        } else {
            $_dbName = 'dreamfactory';
        }
        // default config for local database
        $_dbConfig = array('connectionString' => 'mysql:host=localhost;port=3306;dbname=' . $_dbName, 'username' => 'dsp_user', 'password' => 'dsp_user', 'emulatePrepare' => true, 'charset' => 'utf8', 'enableProfiling' => defined('YII_DEBUG'), 'enableParamLogging' => defined('YII_DEBUG'), 'schemaCachingDuration' => 3600);
    }
}
/**
 * Load up the common configurations between the web and background apps,
 * setting globals whilst at it. REQUIRED file!
 */
/** @noinspection PhpIncludeInspection */
$_commonConfig = (require __DIR__ . COMMON_CONFIG_PATH);
//  Add in our new metadata