Пример #1
0
 $db = new queryFactory();
 $db->connect(DB_SERVER_HOST, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);
 // set application wide parameters for phreebooks module
 $result = $db->Execute_return_error("select configuration_key, configuration_value from " . DB_PREFIX . "configuration");
 if ($db->error_number != '' || $result->RecordCount() == 0) {
     trigger_error(LOAD_CONFIG_ERROR, E_USER_ERROR);
 }
 while (!$result->EOF) {
     define($result->fields['configuration_key'], $result->fields['configuration_value']);
     $result->MoveNext();
 }
 // search the list modules and load configuration files and language files
 gen_pull_language('phreedom', 'menu');
 gen_pull_language('phreebooks', 'menu');
 require_once DIR_FS_MODULES . 'phreedom/config.php';
 $messageStack->debug_header();
 $loaded_modules = array();
 $dirs = scandir(DIR_FS_MODULES);
 foreach ($dirs as $dir) {
     // first pull all module language files, loaded or not
     if ($dir == '.' || $dir == '..') {
         continue;
     }
     if (is_dir(DIR_FS_MODULES . $dir)) {
         gen_pull_language($dir, 'menu');
     }
     if (defined('MODULE_' . strtoupper($dir) . '_STATUS')) {
         // module is loaded
         $loaded_modules[] = $dir;
         require_once DIR_FS_MODULES . $dir . '/config.php';
     }