예제 #1
0
파일: header.php 프로젝트: jaybill/Bolts
     $log_level = (int) $config['application']['log_level'];
 }
 if (is_null(@$config['application']['host_id'])) {
     $host_id = null;
 } else {
     $host_id = $config['application']['host_id'];
 }
 $log_filename = $config['application']['log_filename'];
 Zend_Registry::set('basepath', $basepath);
 Zend_Registry::set('config_file', $config_file);
 Zend_Registry::set('host_id', $host_id);
 // create logger
 $writer = new Zend_Log_Writer_Stream($log_filename);
 $filter = new Zend_Log_Filter_Priority($log_level);
 $writer->addFilter($filter);
 Bolts_Log::registerLogger('default', $writer, true);
 Bolts_Log::report("Log Started", null, Zend_Log::INFO);
 // Create Plugin Manager
 $Bolts_plugin = Bolts_Plugin::getInstance();
 // define constants
 $constants = new Constants();
 set_include_path(get_include_path() . PATH_SEPARATOR . $config['application']['addtl_includes']);
 $databases = new Zend_Config_Ini($config_file, 'databases');
 $dbAdapters = array();
 foreach ($databases->db as $config_name => $db) {
     $dbAdapters[$config_name] = Zend_Db::factory($db->adapter, $db->config->toArray());
     if ((bool) $db->config->default) {
         Zend_Db_Table::setDefaultAdapter($dbAdapters[$config_name]);
     }
 }
 // Store the adapter for use anywhere in our app