Compare commits
No commits in common. "1e59f1b815e3cc06ba193ad3f695d5ad379646ce" and "21b425e32b42b6cd4a48dd2063bea7e2c4bed5aa" have entirely different histories.
1e59f1b815
...
21b425e32b
3 changed files with 8 additions and 19 deletions
|
@ -52,12 +52,12 @@ class App {
|
||||||
|
|
||||||
// Define upload_tmp_dir
|
// Define upload_tmp_dir
|
||||||
if (self::isset('upload_tmp_directory'))
|
if (self::isset('upload_tmp_directory'))
|
||||||
Config :: ini_set('upload_tmp_dir', self::get('upload_tmp_directory', null, 'string'));
|
ini_set('upload_tmp_dir', self::get('upload_tmp_directory', null, 'string'));
|
||||||
if (self::isset('upload_max_filesize')) {
|
if (self::isset('upload_max_filesize')) {
|
||||||
Config :: ini_set('upload_max_filesize', self::get('upload_max_filesize', null, 'string'));
|
ini_set('upload_max_filesize', self::get('upload_max_filesize', null, 'string'));
|
||||||
// post_max_size must be larger than upload_max_filesize
|
// post_max_size must be larger than upload_max_filesize
|
||||||
// See: https://www.php.net/manual/en/ini.core.php#ini.post-max-size
|
// See: https://www.php.net/manual/en/ini.core.php#ini.post-max-size
|
||||||
Config :: ini_set('post_max_size', strval(self::get('upload_max_filesize', null, 'int') * 1.1));
|
ini_set('post_max_size', strval(self::get('upload_max_filesize', null, 'int') * 1.1));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self :: get('log.enabled', true, 'bool'))
|
if (self :: get('log.enabled', true, 'bool'))
|
||||||
|
|
|
@ -222,24 +222,13 @@ Class Config {
|
||||||
for ($i=0; $i < count($exploded_key) - 1; $i++) {
|
for ($i=0; $i < count($exploded_key) - 1; $i++) {
|
||||||
$k = $exploded_key[$i];
|
$k = $exploded_key[$i];
|
||||||
if (!array_key_exists($k, $config))
|
if (!array_key_exists($k, $config))
|
||||||
$parent[$k] = array();
|
$config[$k] = array();
|
||||||
$parent = &$parent[$k];
|
$config = &$config[$k];
|
||||||
}
|
}
|
||||||
$parent[array_pop($exploded_key)] = $value;
|
$config[array_pop($exploded_key)] = $value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to set PHP INI option and log error
|
|
||||||
* @param string $option
|
|
||||||
* @param string|int|float|bool|null $value
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public static function ini_set($option, $value) {
|
|
||||||
if (ini_set($option, $value) === false)
|
|
||||||
Log::warning('Fail to set INI options "%s" to "%s"', $option, $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||||
|
|
|
@ -35,8 +35,8 @@ class Session {
|
||||||
if (is_int($max_duration))
|
if (is_int($max_duration))
|
||||||
self :: $max_duration = $max_duration;
|
self :: $max_duration = $max_duration;
|
||||||
|
|
||||||
Config :: ini_set('session.gc_maxlifetime', strval(self :: $max_duration));
|
ini_set('session.gc_maxlifetime', strval(self :: $max_duration));
|
||||||
Config :: ini_set('session.cookie_lifetime', strval(self :: $max_duration));
|
ini_set('session.cookie_lifetime', strval(self :: $max_duration));
|
||||||
|
|
||||||
// Start session
|
// Start session
|
||||||
session_start();
|
session_start();
|
||||||
|
|
Loading…
Reference in a new issue