PHP < 8.1 ini_set() only accepts strings when declare(strict_types=1); is used

This commit is contained in:
the-djmaze 2023-01-27 16:07:05 +01:00
parent 2750e0698d
commit 32e933b435
4 changed files with 10 additions and 10 deletions

View file

@ -130,7 +130,7 @@ trait Contacts
if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $aFile['tmp_name'])) { if (!$this->FilesProvider()->MoveUploadedFile($oAccount, $sSavedName, $aFile['tmp_name'])) {
$iError = \RainLoop\Enumerations\UploadError::ON_SAVING; $iError = \RainLoop\Enumerations\UploadError::ON_SAVING;
} else { } else {
\ini_set('auto_detect_line_endings', true); \ini_set('auto_detect_line_endings', '1');
$mData = $this->FilesProvider()->GetFile($oAccount, $sSavedName); $mData = $this->FilesProvider()->GetFile($oAccount, $sSavedName);
if ($mData) { if ($mData) {
$sFileStart = \fread($mData, 20); $sFileStart = \fread($mData, 20);
@ -153,7 +153,7 @@ trait Contacts
unset($mData); unset($mData);
$this->FilesProvider()->Clear($oAccount, $sSavedName); $this->FilesProvider()->Clear($oAccount, $sSavedName);
\ini_set('auto_detect_line_endings', false); \ini_set('auto_detect_line_endings', '0');
} }
} }

View file

@ -34,11 +34,11 @@ abstract class Api
\usleep(10000); \usleep(10000);
$oConfig->Load(); $oConfig->Load();
} }
// \ini_set('display_errors', 0); // \ini_set('display_errors', '0');
if ($oConfig->Get('debug', 'enable', false)) { if ($oConfig->Get('debug', 'enable', false)) {
\error_reporting(E_ALL); \error_reporting(E_ALL);
// \ini_set('display_errors', 1); // \ini_set('display_errors', '1');
\ini_set('log_errors', 1); \ini_set('log_errors', '1');
} }
} }
return $oConfig; return $oConfig;

View file

@ -17,9 +17,9 @@ abstract class Stream
{ {
\set_time_limit(0); \set_time_limit(0);
\ob_implicit_flush(); \ob_implicit_flush();
\ini_set('implicit_flush',1); \ini_set('implicit_flush', '1');
\ini_set('output_buffering', 0); \ini_set('output_buffering', '0');
\ini_set('display_errors', 0); \ini_set('display_errors', '0');
if ($i = \ob_get_level()) { if ($i = \ob_get_level()) {
# Clear buffers: # Clear buffers:
while ($i-- && \ob_end_clean()); while ($i-- && \ob_end_clean());

View file

@ -48,8 +48,8 @@ if (!defined('APP_INDEX_ROOT_PATH')) {
// revoke permissions // revoke permissions
umask(0077); umask(0077);
ini_set('register_globals', 0); ini_set('register_globals', '0');
ini_set('xdebug.max_nesting_level', 500); ini_set('xdebug.max_nesting_level', '500');
define('APP_VERSION_ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR); define('APP_VERSION_ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);