Fix deprecations in PHP 8.5 #2639

This commit is contained in:
Kijin Sung 2026-01-01 18:39:20 +09:00
parent 94a5b40435
commit d6b7cb52b8
3 changed files with 13 additions and 4 deletions

View file

@ -10,9 +10,9 @@ if(!defined('__XE__'))
* @brief admin log * @brief admin log
*/ */
$logged_info = Context::get('logged_info'); $logged_info = Context::get('logged_info');
if(Context::get('is_logged') && $logged_info->is_admin == 'Y' && stripos(Context::get('act'), 'admin') !== false && $called_position == 'before_module_proc') if ($called_position === 'before_module_proc' && $logged_info->is_admin === 'Y' && stripos(Context::get('act') ?? '', 'admin') !== false)
{ {
$oAdminloggingController = getController('adminlogging'); $oAdminloggingController = adminloggingController::getInstance();
$oAdminloggingController->insertLog($this->module, $this->act); $oAdminloggingController->insertLog($this->module, $this->act);
} }
/* End of file adminlogging.php */ /* End of file adminlogging.php */

View file

@ -185,7 +185,7 @@ class BaseObject
{ {
$type = $this->get('message_type'); $type = $this->get('message_type');
$typeList = array('error' => 1, 'info' => 1, 'update' => 1); $typeList = array('error' => 1, 'info' => 1, 'update' => 1);
if(!isset($typeList[$type])) if (!isset($type) || !isset($typeList[$type]))
{ {
$type = $this->getError() ? 'error' : 'info'; $type = $this->getError() ? 'error' : 'info';
} }

View file

@ -127,9 +127,18 @@ class DB
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_EMULATE_PREPARES => false, \PDO::ATTR_EMULATE_PREPARES => false,
\PDO::ATTR_STATEMENT_CLASS => array('\Rhymix\Framework\Helpers\DBStmtHelper'), \PDO::ATTR_STATEMENT_CLASS => array('\Rhymix\Framework\Helpers\DBStmtHelper'),
\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => false,
); );
// Use unbuffered queries to reduce memory usage.
if (\PHP_VERSION_ID >= 80400)
{
$options[\PDO\MySQL::ATTR_USE_BUFFERED_QUERY] = false;
}
else
{
$options[\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY] = false;
}
// Preload the statement helper class. // Preload the statement helper class.
class_exists('\Rhymix\Framework\Helpers\DBStmtHelper'); class_exists('\Rhymix\Framework\Helpers\DBStmtHelper');