Compare commits

..

No commits in common. "c346252f556d4d67ca34ba9298fa715bcaa28269" and "227e7bba7fd867d1fde3bdf67f7fc749245a8970" have entirely different histories.

4 changed files with 4 additions and 67 deletions

View file

@ -7,13 +7,9 @@ data_directory: "${root_directory_path}/data"
# Temporary files root directory
tmp_root_directory: "${data_directory}/tmp"
# Temporary uploading files directory (optional, default: PHP ini default)
# Temporary uploading files directory
upload_tmp_directory: ${tmp_root_directory}/uploading"
# Uploading file size limit (in bytes, example: 104857600 == 100Mb)
# (optional, default: PHP ini default)
upload_max_filesize: 104857600
# Main pagetitle
main_pagetitle: "Eesyphp"

View file

@ -7,13 +7,9 @@ data_directory: "${root_directory_path}/data"
# Temporary files root directory
tmp_root_directory: "${data_directory}/tmp"
# Temporary uploading files directory (optional, default: PHP ini default)
# Temporary uploading files directory
upload_tmp_directory: ${tmp_root_directory}/uploading"
# Uploading file size limit (in bytes, example: 104857600 == 100Mb)
# (optional, default: PHP ini default)
upload_max_filesize: 104857600
# Main pagetitle
main_pagetitle: "Eesyphp"

View file

@ -51,14 +51,8 @@ class App {
$sentry_span = new SentrySpan('app.init', 'Application initialization');
// Define upload_tmp_dir
if (self::isset('upload_tmp_directory'))
ini_set('upload_tmp_dir', self::get('upload_tmp_directory', null, 'string'));
if (self::isset('upload_max_filesize')) {
ini_set('upload_max_filesize', self::get('upload_max_filesize', null, 'string'));
// post_max_size must be larger than upload_max_filesize
// See: https://www.php.net/manual/en/ini.core.php#ini.post-max-size
ini_set('post_max_size', strval(self::get('upload_max_filesize', null, 'int') * 1.1));
}
if (is_string(self::get('upload_tmp_directory')))
ini_set('upload_tmp_dir', self::get('upload_tmp_directory'));
if (self :: get('log.enabled', true, 'bool'))
Log::init();
@ -91,17 +85,6 @@ class App {
return !is_null(self :: $root_directory_path);
}
/**
* Check if a specific configuration variable is set
*
* @param string $key The configuration variable key
* @param array|null $config Optional configuration to use instead of current loaded configuration
* @return bool
**/
public static function isset($key, &$config=null) {
return Config::isset($key, self :: $options) || (Config::loaded() && Config::isset($key));
}
/**
* Get a specific option value
*
@ -125,19 +108,6 @@ class App {
);
}
/**
* Set a specific option value
*
* @param string $key The configuration variable key
* @param mixed $value The configuration variable value
* @return boolean
**/
public static function set($key, $value) {
if (Config::isset($key, self :: $options))
return Config::set($key, $value, self :: $options);
return Config::set($key, $value);
}
/**
* Retreive application root directory path
* @return string|null

View file

@ -101,31 +101,6 @@ Class Config {
self :: $extra_variables[$key] = $value;
}
/**
* Check if a specific configuration variable is set
*
* @param string $key The configuration variable key
* @param array|null $config Optional configuration to use instead of current loaded configuration
* @return bool
**/
public static function isset($key, &$config=null) {
if (array_key_exists($key, self :: $extra_variables))
return true;
if (!is_array($config) && !self :: loaded()) {
Log :: fatal('Configuration not loaded (on checking if %s is set)', $key);
exit(1);
}
$exploded_key = explode('.', $key);
if (!is_array($exploded_key)) return false;
$value = is_array($config)?$config:self :: $config;
foreach ($exploded_key as $k) {
if (!is_array($value) || !isset($value[$k]))
return false;
$value = $value[$k];
}
return true;
}
/**
* Get a specific configuration variable value
*