config() public méthode

Configure framework according to .ini-style file settings; If optional 2nd arg is provided, template strings are interpreted
public config ( $file, $allow = FALSE ) : object
$file string
$allow bool
Résultat object
Exemple #1
0
 /**
  * 清理
  */
 public function clear()
 {
     self::$frameworkPath = '';
     self::$projectPath = '';
     self::$projectName = '';
     self::$config = '';
     self::$import = '';
     self::$hostInfo = '';
     self::$pathInfo = '';
     self::$homeUrl = '';
     self::$baseUrl = '';
     self::$defaultControl = '';
 }
Exemple #2
0
include_once BASE_PATH . '/system/classes/ApplicationBase.php';
// Get the Helper Base
include_once BASE_PATH . '/system/classes/HelperBase.php';
// Load database information
$db_info = spyc_load_file(BASE_PATH . '/config/database.yml');
if (isset($db_info['default'])) {
    if (isset($db_info[ENVIRONMENT])) {
        $db_info[ENVIRONMENT] = array_merge($db_info['default'], $db_info[ENVIRONMENT]);
    }
    unset($db_info['default']);
}
$config[ENVIRONMENT]['DB_HOST'] = $db_info[ENVIRONMENT]['host'];
$config[ENVIRONMENT]['DB_USER'] = $db_info[ENVIRONMENT]['user'];
$config[ENVIRONMENT]['DB_PASS'] = $db_info[ENVIRONMENT]['password'];
$config[ENVIRONMENT]['DB_NAME'] = $db_info[ENVIRONMENT]['database_name'];
unset($db_info);
// Done loading database info and putting it into $config array
// Connect to the database
ActiveRecord\Config::initialize(function ($cfg) {
    $cfg->set_model_directory(APP_PATH . '/models');
    $cfg->set_connections(array(ENVIRONMENT => 'mysql://' . Base::config('DB_USER') . ':' . Base::config('DB_PASS') . '@' . Base::config('DB_HOST') . '/' . Base::config('DB_NAME') . ''));
});
// Load the routes
include_once BASE_PATH . '/config/routes.php';
// Include the ApplicationController
include_once APP_PATH . '/controllers/application_controller.php';
// Store the flashes
$flash = $_SESSION['borealis_flash'];
$_SESSION['borealis_flash'] = array();
// Start including the controller and views
$Map->load();