function Config_File::load_file in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/lib/smarty/Config_File.class.php \Config_File::load_file()
Load a configuration file manually.
Parameters
string $file_name file name to load:
boolean $prepend_path whether current config path should be: prepended to the filename
1 call to Config_File::load_file()
- Config_File::get in includes/
moodle/ lib/ smarty/ Config_File.class.php - Retrieves config info based on the file, section, and variable name.
File
- includes/
moodle/ lib/ smarty/ Config_File.class.php, line 228
Class
- Config_File
- Config file reading class @package Smarty
Code
function load_file($file_name, $prepend_path = true) {
if ($prepend_path && $this->_config_path != "") {
$config_file = $this->_config_path . $file_name;
}
else {
$config_file = $file_name;
}
ini_set('track_errors', true);
$fp = @fopen($config_file, "r");
if (!is_resource($fp)) {
$this
->_trigger_error_msg("Could not open config file '{$config_file}'");
return false;
}
$contents = ($size = filesize($config_file)) ? fread($fp, $size) : '';
fclose($fp);
$this->_config_data[$config_file] = $this
->parse_contents($contents);
return true;
}