示例#1
0
 /**
  * Loads the main configuration ini file and adds it to the registry.
  * The 'config' directory will be updated to have the provided profile
  * appended to it, e.g. './config' becomes './config/default'
  *
  * @param string $profile
  * @return object
  */
 public function loadConfig($profile)
 {
     if (Registry::has('config') && Registry::has('config_ini')) {
         return Registry::get('config');
     }
     $configDir = $this->getDir('config') . '/' . $profile;
     try {
         $configIni = new Config_ini();
         $configIni->load($configDir . '/config.ini.php');
         Registry::register('config_ini', $configIni);
         // Merge the ini configuration in to the main config library
         $config = new Config();
         $config->load($configIni);
         Registry::register('config', $config);
         // Store the profile name and update the 'config' dir value
         $this->setDir('config', $configDir);
         $this->configProfile = $profile;
         $this->configPath = $configDir . '/config.ini.php';
         return $config;
     } catch (Config_Ini_FileNoExist $e) {
         throw new Zula_Exception('Zula configuration file "' . $configDir . '/config.ini.php" does not exist or is not readable', 8);
     }
 }
示例#2
0
文件: config.php 项目: TraianAlex/dev
Hash::init();
//----------------------4 ERROR REPORTING ---------------------------------------------
if ($local == false) {
    //set_error_handler('Errors::my_error_handler_prod');
    set_error_handler('Errors::my_error_handler', E_ALL);
    if (isset($_SESSION['system_error_message'])) {
        error_log($_SESSION['system_error_message'] . "\n", 3, "/home/remb4372/public_html/traian4/new-pdo/error.log");
    }
} else {
    set_error_handler('Errors::my_error_handler', E_ALL);
    if (isset($_SESSION['system_error_message'])) {
        error_log($_SESSION['system_error_message'] . "\n", 3, "C:\\Users\\victor92\\OneDrive\\htdocs\\traian4\\new-pdo\\error.log");
    }
}
// ------------ 5 CONFIG KEYS, ENCRYPTION FROM INI FILE ----------------------------
$sec = Config_ini::getConfig("sec");
define('SUP', $sec['sup']);
define('PWD', $sec['pwd']);
define("K", $sec['k']);
//for session user
define("K1", $sec['k1']);
//for session admin
define("KS", $sec['ks']);
//for admin
// Get a key from https://www.google.com/recaptcha/admin/create
define('PUB_KEY', $sec['pub_key']);
define('PRIV_KEY', $sec['priv_key']);
//for hidden input in registration users
define('FV', crypt($sec['fv1'], '$' . $sec['fv2']));
//for my encryption functions
//define('IV', mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND));