コード例 #1
0
            // execute the sql
            require_once DIR_FS_MODULES . 'general/language/' . $_SESSION['language'] . '/language.php';
            require $filepath;
            execute_upgrade();
        } else {
            die('Trying to upgrade to Release ' . PROJECT_VERSION_MAJOR . '.' . PROJECT_VERSION_MINOR . ' but the upgrade file could not be found!');
        }
    }
    // load currency classes
    require DIR_FS_CLASSES . 'currencies.php';
    $currencies = new currencies();
}
// initialize the message stack for output messages, must be after session starts and configuration variables load
require DIR_FS_CLASSES . 'message_stack.php';
$messageStack = new messageStack();
$messageStack->debug("\nGET Vars = " . arr2string($_GET));
$messageStack->debug("\nPOST Vars = " . arr2string($_POST));
// pull in the custom language over-rides for this module (to pre-define the standard language)
$custom_path = DIR_FS_MY_FILES . 'custom/' . $cat . '/' . $module . '/extra_defines.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
// load general language translation, Check for global define overrides first
$extra_datafiles_dir = DIR_FS_MY_FILES . 'custom/extra_defines/';
if ($dir = @dir($extra_datafiles_dir)) {
    while ($file = $dir->read()) {
        if (!is_dir($extra_datafiles_dir . $file)) {
            if (preg_match('/\\.php$/', $file) > 0) {
                include_once $extra_datafiles_dir . $file;
            }
        }
コード例 #2
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
 if (strlen($db_name) < 1) {
     $error = $messageStack->add(ERROR_TEXT_DB_NAME_ISEMPTY, 'error');
 }
 if (strlen($db_username) < 1) {
     $error = $messageStack->add(ERROR_TEXT_DB_USERNAME_ISEMPTY, 'error');
 }
 if (strlen($db_password) < 1) {
     $error = $messageStack->add(ERROR_TEXT_DB_PASSWORD_ISEMPTY, 'error');
 }
 // define some things so the install can use existing functions
 define('DB_PREFIX', $db_prefix);
 $_SESSION['company'] = $db_name;
 $_SESSION['language'] = $lang;
 // create the company directory
 if (DEBUG) {
     $messageStack->debug("\n  creating the company directory");
 }
 if (!file_exists(DIR_FS_ADMIN . PATH_TO_MY_FILES . $db_name)) {
     if (!@mkdir(DIR_FS_ADMIN . PATH_TO_MY_FILES . $db_name)) {
         $error = $messageStack->add(sprintf(MSG_ERROR_CREATE_MY_FILES, DIR_FS_ADMIN . PATH_TO_MY_FILES . $db_name), 'error');
     }
 }
 if (!$error) {
     // write the db config.php in the company directory
     if (!install_build_co_config_file($db_name, $db_name . '_TITLE', $company_name)) {
         $error = true;
     }
     if (!install_build_co_config_file($db_name, 'DB_SERVER_USERNAME', $db_username)) {
         $error = true;
     }
     if (!install_build_co_config_file($db_name, 'DB_SERVER_PASSWORD', $db_password)) {