Set upload_tmp_directory & upload_max_filesize INI parameters after log initialized
This commit is contained in:
parent
7166e63032
commit
5ca3208c91
1 changed files with 11 additions and 10 deletions
21
src/App.php
21
src/App.php
|
@ -67,16 +67,6 @@ class App {
|
|||
$sentry_transaction = new SentryTransaction();
|
||||
$sentry_span = new SentrySpan('app.init', 'Application initialization');
|
||||
|
||||
// Define upload_tmp_dir
|
||||
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));
|
||||
}
|
||||
|
||||
if (self :: get('log.enabled', null, 'bool'))
|
||||
Log::init();
|
||||
if (self :: get('session.enabled', null, 'bool'))
|
||||
|
@ -97,6 +87,17 @@ class App {
|
|||
I18n::init();
|
||||
if (self :: get('cli.enabled', null, 'bool'))
|
||||
Cli::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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue