public function testDetect() { $env = Environment::detect(); $this->assertEquals('development', $env); putenv("PHP_ROXPHP_ENV=production"); $env = Environment::detect(); $this->assertEquals('production', $env); }
/** * RoxPHP * * Copyright (C) 2008 - 2012 Ramon Torres * * Licensed under The MIT License * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) 2008 - 2012 Ramon Torres * @package App * @license The MIT License (http://www.opensource.org/licenses/mit-license.php) */ use rox\active_record\ConnectionManager; use rox\util\Environment; switch (Environment::get()) { /* case 'production': // Production database configuration ConnectionManager::setConfig('default', array( 'host' => '127.0.0.1', 'username' => 'root', 'password' => '', 'database' => 'rox_app' )); break; case 'staging': // Development database configuration ConnectionManager::setConfig('default', array( 'host' => '127.0.0.1',
<?php use rox\util\Environment; $environment = Environment::detect(); require_once __DIR__ . "/environments/{$environment}.php";