Remove upload_max_filesize stuff since is not possible to change it at runtime

This commit is contained in:
Benjamin Renard 2024-12-13 15:49:57 +01:00
parent 88b22ca22b
commit e8cb6a0343
Signed by: bn8
GPG key ID: 3E2E1CE1907115BC
5 changed files with 0 additions and 29 deletions

View file

@ -10,10 +10,6 @@ tmp_root_directory: "${data_directory}/tmp"
# Temporary uploading files directory (optional, default: PHP ini default) # Temporary uploading files directory (optional, default: PHP ini default)
upload_tmp_directory: ${tmp_root_directory}/uploading" 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
main_pagetitle: "Eesyphp" main_pagetitle: "Eesyphp"

View file

@ -46,9 +46,6 @@ App::init(
"static/lib" "static/lib"
), ),
), ),
'default' => array(
'upload_max_filesize' => 10485760,
),
), ),
$root_dir_path $root_dir_path
); );

View file

@ -10,10 +10,6 @@ tmp_root_directory: "${data_directory}/tmp"
# Temporary uploading files directory (optional, default: PHP ini default) # Temporary uploading files directory (optional, default: PHP ini default)
upload_tmp_directory: ${tmp_root_directory}/uploading" 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
main_pagetitle: "Eesyphp" main_pagetitle: "Eesyphp"

View file

@ -45,7 +45,6 @@ class App {
array( array(
'overwrite_config_files' => array(), 'overwrite_config_files' => array(),
'upload_tmp_directory' => null, 'upload_tmp_directory' => null,
'upload_max_filesize' => null,
'sentry.enabled' => true, 'sentry.enabled' => true,
'log.enabled' => true, 'log.enabled' => true,
'session.enabled' => true, 'session.enabled' => true,
@ -92,16 +91,6 @@ class App {
if (self :: get('db.enabled', null, 'bool')) if (self :: get('db.enabled', null, 'bool'))
Db::init(); Db::init();
// Define common upload_tmp_dir & upload_max_filesize PHP ini
if (self::isset('upload_tmp_directory'))
Config :: ini_set('upload_tmp_dir', self::get('upload_tmp_directory', null, 'string'));
if (self::isset('upload_max_filesize')) {
Config :: 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
Config :: ini_set('post_max_size', strval(self::get('upload_max_filesize', null, 'int') * 1.1));
}
$sentry_span->finish(); $sentry_span->finish();
} }

View file

@ -108,7 +108,6 @@ class Tpl {
'included_css_files' => ["css/app.css"], 'included_css_files' => ["css/app.css"],
'included_js_files' => ["js/app.js"], 'included_js_files' => ["js/app.js"],
'webstats_js_code' => null, 'webstats_js_code' => null,
'upload_max_filesize' => null,
'debug_ajax' => App::get('debug_ajax', false, 'bool'), 'debug_ajax' => App::get('debug_ajax', false, 'bool'),
'logo_url' => 'images/logo.svg', 'logo_url' => 'images/logo.svg',
'favicon_url' => 'images/favicon.png', 'favicon_url' => 'images/favicon.png',
@ -548,12 +547,6 @@ class Tpl {
'webstats_js_code', 'webstats_js_code',
App::get('webstats_js_code', null, 'string')); App::get('webstats_js_code', null, 'string'));
// Upload max size
if (App::get('upload_max_filesize', null, 'int'))
Tpl :: assign(
'upload_max_filesize',
App::get('upload_max_filesize', null, 'int'));
$init_time = App::get('init_time'); $init_time = App::get('init_time');
Tpl :: assign('compute_time', $init_time?format_duration(hrtime(true)-$init_time, 'ns', 'ms'):null); Tpl :: assign('compute_time', $init_time?format_duration(hrtime(true)-$init_time, 'ns', 'ms'):null);
Tpl :: assign('db_time', Db :: $total_query_time?format_duration(Db :: $total_query_time, 'ns', 'ms'):null); Tpl :: assign('db_time', Db :: $total_query_time?format_duration(Db :: $total_query_time, 'ns', 'ms'):null);