$_value = json_encode($_value); } if (false === putenv($_key . '=' . $_value)) { Log::error('Error setting environment variable: ' . $_key . ' = ' . $_value); } } } } /** * 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; $_dbConfig = 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);
$_value = json_encode($_value); } if (false === putenv($_key . '=' . $_value)) { Log::error('Error setting environment variable: ' . $_key . ' = ' . $_value); } } } } /** * 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);
* * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ use DreamFactory\Platform\Utility\Fabric; /** * database.config.php * The database configuration file for the DSP */ if (Fabric::fabricHosted()) { return Fabric::initialize(); } /** * Database names vary by type of DSP: * * 1. Free Edition/Hosted: DSP name * 2. Hosted Private: hpp_<DSP Name> * 3. All others: dreamfactory * */ if (false !== ($_host = Fabric::hostedPrivatePlatform(true))) { $_dbName = 'hpp_' . str_ireplace(array('.dreamfactory.com', '-', '.cloud', '.'), array(null, '_', null, '_'), $_host); } else { $_dbName = 'dreamfactory'; } $_dbUser = '******';