From dd2b5aecb3f63d35c3c9466afdf65f8212dc3ae3 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 29 Oct 2025 10:19:07 +0900 Subject: [PATCH 01/34] Version 2.1.28 --- common/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/constants.php b/common/constants.php index 341009623..621cf20c5 100644 --- a/common/constants.php +++ b/common/constants.php @@ -3,7 +3,7 @@ /** * RX_VERSION is the version number of the Rhymix CMS. */ -define('RX_VERSION', '2.1.27'); +define('RX_VERSION', '2.1.28'); /** * RX_MICROTIME is the startup time of the current script, in microseconds since the Unix epoch. From af8e510ca22732c320cf2ed32d96042686069163 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 29 Oct 2025 10:25:45 +0900 Subject: [PATCH 02/34] Clear cache after modifying document_extra_keys table --- modules/document/document.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/document/document.class.php b/modules/document/document.class.php index 82d34909b..a1421f145 100644 --- a/modules/document/document.class.php +++ b/modules/document/document.class.php @@ -238,6 +238,7 @@ class Document extends ModuleObject if(!$oDB->isColumnExists('document_extra_keys', 'var_sort')) { $oDB->addColumn('document_extra_keys', 'var_sort', 'char', '1', 'N', true, 'var_search'); + Rhymix\Framework\Cache::clearGroup('site_and_module'); } if(!$oDB->isColumnExists('document_extra_vars', 'sort_value') || !$oDB->isIndexExists('document_extra_vars', 'idx_sort_value')) { From 30d79120541a8d6f0857ee52dde6ab741d13c0e8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 29 Oct 2025 16:55:15 +0900 Subject: [PATCH 03/34] Fix inefficient extra_vars loading query --- modules/document/document.class.php | 5 +++++ modules/document/queries/getDocumentExtraVars.xml | 1 - modules/document/schemas/document_extra_vars.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/document/document.class.php b/modules/document/document.class.php index a1421f145..fc9cc8cce 100644 --- a/modules/document/document.class.php +++ b/modules/document/document.class.php @@ -113,6 +113,7 @@ class Document extends ModuleObject // 2025.10.23 Add sort to document_extra_keys table, and sort_value to document_extra_vars table if(!$oDB->isColumnExists('document_extra_keys', 'var_sort')) return true; if(!$oDB->isColumnExists('document_extra_vars', 'sort_value') || !$oDB->isIndexExists('document_extra_vars', 'idx_sort_value')) return true; + if(!$oDB->isIndexExists('document_extra_vars', 'idx_document_var_idx')) return true; if(!$oDB->isIndexExists('document_extra_vars', 'idx_prefix_value')) return true; // Delete unnecessary index @@ -265,6 +266,10 @@ class Document extends ModuleObject $oDB->commit(); $oDB->addIndex('document_extra_vars', 'idx_sort_value', array('module_srl', 'sort_value')); } + if(!$oDB->isIndexExists('document_extra_vars', 'idx_document_var_idx')) + { + $oDB->addIndex('document_extra_vars', 'idx_document_var_idx', array('document_srl', 'var_idx')); + } if(!$oDB->isIndexExists('document_extra_vars', 'idx_prefix_value')) { $oDB->addIndex('document_extra_vars', 'idx_prefix_value', array('module_srl', 'value(10)')); diff --git a/modules/document/queries/getDocumentExtraVars.xml b/modules/document/queries/getDocumentExtraVars.xml index 34c723265..f02d67b65 100644 --- a/modules/document/queries/getDocumentExtraVars.xml +++ b/modules/document/queries/getDocumentExtraVars.xml @@ -6,7 +6,6 @@ - diff --git a/modules/document/schemas/document_extra_vars.xml b/modules/document/schemas/document_extra_vars.xml index f1707a66a..05bf6ba61 100644 --- a/modules/document/schemas/document_extra_vars.xml +++ b/modules/document/schemas/document_extra_vars.xml @@ -6,6 +6,7 @@ + From 0ca46654aacf96c68d8f414e0d8cbb5b9bab79b2 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 30 Oct 2025 12:39:37 +0900 Subject: [PATCH 04/34] Rename $columnList to $reload_counts in getDocument() --- modules/document/document.item.php | 25 +++++++++---------------- modules/document/document.model.php | 6 +++--- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 1fdf94d8f..0b5e5609e 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -65,14 +65,13 @@ class DocumentItem extends BaseObject * Constructor * @param int $document_srl * @param bool $load_extra_vars - * @param array columnList + * @param bool $reload_counts * @return void */ - function __construct($document_srl = 0, $load_extra_vars = true, $columnList = array()) + function __construct($document_srl = 0, $load_extra_vars = true, $reload_counts = true) { $this->document_srl = $document_srl; - $this->columnList = $columnList; - $this->_loadFromDB($load_extra_vars); + $this->_loadFromDB($load_extra_vars, $reload_counts); } function setDocument($document_srl, $load_extra_vars = true) @@ -86,23 +85,13 @@ class DocumentItem extends BaseObject * @param bool $load_extra_vars * @return void */ - function _loadFromDB($load_extra_vars = true) + function _loadFromDB($load_extra_vars = true, $reload_counts = true) { if(!$this->document_srl) { return; } - $document_item = false; - $columnList = array(); - $reload_counts = true; - - if ($this->columnList === false) - { - $reload_counts = false; - } - $this->columnList = array(); - // cache controll $cache_key = 'document_item:' . getNumberingPath($this->document_srl) . $this->document_srl; $document_item = Rhymix\Framework\Cache::get($cache_key); @@ -110,8 +99,12 @@ class DocumentItem extends BaseObject { $columnList = array('readed_count', 'voted_count', 'blamed_count', 'comment_count', 'trackback_count'); } + else + { + $columnList = []; + } - if(!$document_item || $reload_counts) + if(!$document_item || $reload_counts !== false) { $args = new stdClass(); $args->document_srl = $this->document_srl; diff --git a/modules/document/document.model.php b/modules/document/document.model.php index d06a44f82..ee7165775 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -149,10 +149,10 @@ class DocumentModel extends Document * @param int $document_srl * @param bool $is_admin * @param bool $load_extra_vars - * @param array $columnList + * @param bool $reload_counts * @return documentItem */ - public static function getDocument($document_srl = 0, $is_admin = false, $load_extra_vars = true, $columnList = array()) + public static function getDocument($document_srl = 0, $is_admin = false, $load_extra_vars = true, $reload_counts = true) { if(!$document_srl) { @@ -160,7 +160,7 @@ class DocumentModel extends Document } if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) { - $oDocument = new documentItem($document_srl, $load_extra_vars, $columnList); + $oDocument = new documentItem($document_srl, $load_extra_vars, $reload_counts); if(!$oDocument->isExists()) { return $oDocument; From d671f0468c0b4b39bd16e247f1a29cc89b18a5dc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 5 Nov 2025 11:51:07 +0900 Subject: [PATCH 05/34] Explicitly mark _loadDesktopJSCSS() as public, to ensure backward compatibility --- classes/display/HTMLDisplayHandler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 609fe787a..c2f570ad5 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -728,7 +728,7 @@ class HTMLDisplayHandler * import basic .js files. * @return void */ - function _loadDesktopJSCSS() + public function _loadDesktopJSCSS() { $this->_loadCommonJSCSS(); } From 47cb8ca4ff06b24120eb97ab2fe1f5fa7d34c442 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 5 Nov 2025 11:51:56 +0900 Subject: [PATCH 06/34] Fix double escape of filename in short download URL #2611 --- modules/file/file.controller.php | 4 ++-- modules/file/file.model.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index cf1842a9e..01702a6b5 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -307,7 +307,7 @@ class FileController extends File $file_srl = Context::get('file_srl'); $sid = Context::get('sid'); - $filename_arg = Context::get('filename'); + $filename_arg = htmlspecialchars_decode(Context::get('filename')); // Get file information from the DB $file_obj = FileModel::getFile($file_srl); @@ -434,7 +434,7 @@ class FileController extends File // Get requsted file info $file_srl = Context::get('file_srl'); $file_key = Context::get('file_key'); - $filename_arg = Context::get('filename'); + $filename_arg = htmlspecialchars_decode(Context::get('filename')); $columnList = array('source_filename', 'uploaded_filename', 'file_size'); $file_obj = FileModel::getFile($file_srl, $columnList); diff --git a/modules/file/file.model.php b/modules/file/file.model.php index 4a1c40e7b..ba69f6c6e 100644 --- a/modules/file/file.model.php +++ b/modules/file/file.model.php @@ -476,8 +476,8 @@ class FileModel extends File $nullList = array(); foreach ($output->data as $file) { - $file->source_filename = escape($file->source_filename, false); $file->download_url = self::getDownloadUrl($file->file_srl, $file->sid, 0, $file->source_filename); + $file->source_filename = escape($file->source_filename, false); $fileList[] = $file; if ($file->upload_target_type === null) { From df3e6b157a6e36c664bb35029c4f5aea3dffcdc8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 5 Nov 2025 11:55:32 +0900 Subject: [PATCH 07/34] Fix uninitialized variable --- modules/autoinstall/autoinstall.admin.view.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index f49d99062..31d34f040 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -342,6 +342,7 @@ class autoinstallAdminView extends autoinstall $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); $xml_lUpdate = new XeXmlParser(); $xmlDoc = $xml_lUpdate->parse($buff); + $item_list = array(); $res = array(); if($xmlDoc && $xmlDoc->response->packagelist->item) { From b9d79949b151915bc7c0d9b86080f7676bc1c3d7 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 7 Nov 2025 12:57:19 +0900 Subject: [PATCH 08/34] Fix type mismatch when filename argument is missing --- modules/file/file.controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 01702a6b5..ba8876dbf 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -307,7 +307,7 @@ class FileController extends File $file_srl = Context::get('file_srl'); $sid = Context::get('sid'); - $filename_arg = htmlspecialchars_decode(Context::get('filename')); + $filename_arg = htmlspecialchars_decode(Context::get('filename') ?? ''); // Get file information from the DB $file_obj = FileModel::getFile($file_srl); @@ -318,7 +318,7 @@ class FileController extends File { throw new Rhymix\Framework\Exceptions\TargetNotFound('msg_file_not_found'); } - if ($filename_arg !== null && $filename_arg !== $filename) + if ($filename_arg !== '' && $filename_arg !== $filename) { throw new Rhymix\Framework\Exceptions\TargetNotFound('msg_file_not_found'); } @@ -434,7 +434,7 @@ class FileController extends File // Get requsted file info $file_srl = Context::get('file_srl'); $file_key = Context::get('file_key'); - $filename_arg = htmlspecialchars_decode(Context::get('filename')); + $filename_arg = htmlspecialchars_decode(Context::get('filename') ?? ''); $columnList = array('source_filename', 'uploaded_filename', 'file_size'); $file_obj = FileModel::getFile($file_srl, $columnList); @@ -460,7 +460,7 @@ class FileController extends File } // Check filename if given - if ($filename_arg !== null && $filename_arg !== $filename) + if ($filename_arg !== '' && $filename_arg !== $filename) { throw new Rhymix\Framework\Exceptions\TargetNotFound('msg_file_not_found'); } From f5389fb964053e0dd7845c3294509092fc5127ed Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 12 Nov 2025 21:43:18 +0900 Subject: [PATCH 09/34] Add admin/ to cleanup list --- modules/admin/controllers/maintenance/Cleanup.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/admin/controllers/maintenance/Cleanup.php b/modules/admin/controllers/maintenance/Cleanup.php index 350b6f232..1ea397361 100644 --- a/modules/admin/controllers/maintenance/Cleanup.php +++ b/modules/admin/controllers/maintenance/Cleanup.php @@ -284,6 +284,7 @@ class Cleanup extends Base 'addons/member_communication/' => 'deleted:xe', 'addons/mobile/' => 'deleted:xe', 'addons/openid_delegation_id/' => 'deleted:xe', + 'admin/' => 'deleted:xe', 'classes/cache/CacheApc.class.php' => 'deleted:xe', 'classes/cache/CacheFile.class.php' => 'deleted:xe', 'classes/cache/CacheMemcache.class.php' => 'deleted:xe', From 64d998297810cee07aa8746b6e15fbdc6afbf40b Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 12 Nov 2025 21:50:02 +0900 Subject: [PATCH 10/34] Fix missing message options in admin document manage modal #2610 --- modules/document/tpl/document_list.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index 575db6a0b..d93c38115 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -167,8 +167,20 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}'; -
- +
+ + + +
@@ -231,5 +243,13 @@ jQuery(function($){ } } }); + $('#message').prop('disabled', true); + $('#message_options').on('change', 'input[name="send_message"]', function(){ + if($('#send_custom_message').is(':checked')) { + $('#message').prop("disabled", false); + } else { + $('#message').prop("disabled", true); + } + }); }); From a8749f107827b9bcda2771846d68a018d1f29716 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Wed, 12 Nov 2025 21:55:49 +0900 Subject: [PATCH 11/34] Clean up dead code #2612 --- modules/module/module.admin.controller.php | 8 -------- modules/module/module.controller.php | 5 ++--- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/modules/module/module.admin.controller.php b/modules/module/module.admin.controller.php index 8e4338cfb..ae7349cdb 100644 --- a/modules/module/module.admin.controller.php +++ b/modules/module/module.admin.controller.php @@ -326,8 +326,6 @@ class ModuleAdminController extends Module if(strlen($default)) { $grant->{$grant_name}[] = $default; - continue; - // users in a particular group } else { @@ -339,9 +337,7 @@ class ModuleAdminController extends Module else $group_srls = array($group_srls); $grant->{$grant_name} = $group_srls; } - continue; } - $grant->{$group_srls} = array(); // dead code???? } // Stored in the DB @@ -609,8 +605,6 @@ class ModuleAdminController extends Module if(strlen($default)) { $grant->{$grant_name}[] = $default; - continue; - // Users in a particular group } else { @@ -625,9 +619,7 @@ class ModuleAdminController extends Module } $grant->{$grant_name} = $group_srls; } - continue; } - $grant->{$group_srls} = array(); // dead code, too?? } // Stored in the DB diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php index c7916f4cc..2df916409 100644 --- a/modules/module/module.controller.php +++ b/modules/module/module.controller.php @@ -937,8 +937,8 @@ class ModuleController extends Module } if(!$output->toBool()) { - return $output; $oDB->rollback(); + return $output; } } @@ -1192,12 +1192,11 @@ class ModuleController extends Module $args->module_filebox_srl = $vars->module_filebox_srl; $args->comment = $vars->comment; - return executeQuery('module.updateModuleFileBox', $args); + $output = executeQuery('module.updateModuleFileBox', $args); $output->add('save_filename', $save_filename); return $output; } - /** * @brief Add a file into the file box */ From 2eaf869ebae1d13c23598335ae837b39fdf2590f Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 13 Nov 2025 22:18:31 +0900 Subject: [PATCH 12/34] Improve calculation of GD memory usage to support larger images --- classes/file/FileHandler.class.php | 48 ++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index f80ed9dfd..698b6470e 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -461,18 +461,28 @@ class FileHandler * Check available memory to load image file * * @param array $imageInfo Image info retrieved by getimagesize function + * @param array $resizeInfo Resize width and height * @return bool TRUE: it's ok, FALSE: otherwise */ - public static function checkMemoryLoadImage(&$imageInfo) + public static function checkMemoryLoadImage($imageInfo, $resizeInfo = []) { - $K64 = 65536; - $TWEAKFACTOR = 2.0; - $channels = $imageInfo['channels'] ?? 6; - if(!$channels) + $bits = $imageInfo['bits'] ?? 8; + $channels = ($imageInfo['channels'] ?? 6) ?: 6; // for png + if (!$resizeInfo) { - $channels = 6; //for png + $resizeInfo = $imageInfo; } - $memoryNeeded = round(($imageInfo[0] * $imageInfo[1] * $imageInfo['bits'] * $channels / 8 + $K64 ) * $TWEAKFACTOR); + $src_memory = round($imageInfo[0] * $imageInfo[1] * $bits * $channels / 8) + 65536; + $dst_memory = round($resizeInfo[0] * $resizeInfo[1] * 8 * $channels / 8) + 65536; + + $gd_info = gd_info(); + $gd_version = $gd_info['GD Version'] ?? ''; + $gd_type = str_contains($gd_version, 'bundled') ? 'bundled' : 'external'; + if ($gd_type === 'external') + { + $dst_memory = 0; + } + $memoryLimit = ini_get('memory_limit'); if($memoryLimit <= 0) { @@ -484,7 +494,7 @@ class FileHandler return true; } $availableMemory = $memoryLimit - memory_get_usage(); - if($availableMemory < $memoryNeeded) + if($availableMemory < ($src_memory + $dst_memory)) { return false; } @@ -559,11 +569,6 @@ class FileHandler // retrieve source image's information $imageInfo = getimagesize($source_file); - if(!self::checkMemoryLoadImage($imageInfo)) - { - return false; - } - list($width, $height, $type) = $imageInfo; if($width < 1 || $height < 1) { @@ -596,6 +601,12 @@ class FileHandler $resize_height = round($resize_width / ($width / $height)); } + // Check memory usage + if(!self::checkMemoryLoadImage($imageInfo, [$resize_width, $resize_height])) + { + return false; + } + // create temporary image having original type if ($type === 'gif' && function_exists('imagecreatefromgif')) { @@ -646,6 +657,8 @@ class FileHandler $thumb = imagecreatetruecolor($resize_width, $resize_height); if (!$thumb) { + imagedestroy($source); + unset($source); return false; } @@ -706,6 +719,9 @@ class FileHandler imagecopyresampled($thumb, $source, $dst_x, $dst_y, 0, 0, $dst_width, $dst_height, $width, $height); } + imagedestroy($source); + unset($source); + // create directory self::makeDir(dirname($target_file)); @@ -736,12 +752,14 @@ class FileHandler } else { + imagedestroy($thumb); + unset($thumb); return false; } - imagedestroy($thumb); - imagedestroy($source); @chmod($target_file, 0666 & ~Rhymix\Framework\Storage::getUmask()); + imagedestroy($thumb); + unset($thumb); return $output; } From 950b1c40748ff83898cbec96a03adae94b0e29f8 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 17 Nov 2025 09:41:47 +0900 Subject: [PATCH 13/34] Don't use imagedestroy() in PHP 8.0 or higher --- classes/file/FileHandler.class.php | 37 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index 698b6470e..58c6898e2 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -657,8 +657,14 @@ class FileHandler $thumb = imagecreatetruecolor($resize_width, $resize_height); if (!$thumb) { - imagedestroy($source); - unset($source); + if (version_compare(PHP_VERSION, '8.0', '<')) + { + imagedestroy($source); + } + else + { + unset($source); + } return false; } @@ -719,8 +725,10 @@ class FileHandler imagecopyresampled($thumb, $source, $dst_x, $dst_y, 0, 0, $dst_width, $dst_height, $width, $height); } - imagedestroy($source); - unset($source); + if (version_compare(PHP_VERSION, '8.0', '>=')) + { + unset($source); + } // create directory self::makeDir(dirname($target_file)); @@ -752,14 +760,27 @@ class FileHandler } else { - imagedestroy($thumb); - unset($thumb); + if (version_compare(PHP_VERSION, '8.0', '<')) + { + imagedestroy($thumb); + } + else + { + unset($thumb); + } return false; } @chmod($target_file, 0666 & ~Rhymix\Framework\Storage::getUmask()); - imagedestroy($thumb); - unset($thumb); + + if (version_compare(PHP_VERSION, '8.0', '<')) + { + imagedestroy($thumb); + } + else + { + unset($thumb); + } return $output; } From e586552b299876b859fc38e2a5a66bcf6a52a0d3 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 22 Nov 2025 21:02:26 +0900 Subject: [PATCH 14/34] Update PHP install script for unit test, now that PHP 8.5 is official --- .github/workflows/setup-php.sh | 58 +++++++++++----------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/.github/workflows/setup-php.sh b/.github/workflows/setup-php.sh index e978e92a0..ef9b1656c 100644 --- a/.github/workflows/setup-php.sh +++ b/.github/workflows/setup-php.sh @@ -4,47 +4,27 @@ sudo add-apt-repository -y ppa:ondrej/php # Install all required packages -if [[ "$1" == "8.5" ]]; then - sudo apt -y install \ - php$1-bcmath \ - php$1-cli \ - php$1-common \ - php$1-curl \ - php$1-gd \ - php$1-intl \ - php$1-mbstring \ - php$1-mysql \ - php$1-readline \ - php$1-sqlite3 \ - php$1-xml \ - php$1-zip -else - sudo apt -y install \ - php$1-apcu \ - php$1-bcmath \ - php$1-cli \ - php$1-common \ - php$1-curl \ - php$1-gd \ - php$1-intl \ - php$1-mbstring \ - php$1-mysql \ - php$1-opcache \ - php$1-readline \ - php$1-sqlite3 \ - php$1-xml \ - php$1-zip -fi +sudo apt -y install \ + php$1-apcu \ + php$1-bcmath \ + php$1-cli \ + php$1-common \ + php$1-curl \ + php$1-gd \ + php$1-intl \ + php$1-mbstring \ + php$1-mysql \ + php$1-readline \ + php$1-sqlite3 \ + php$1-xml \ + php$1-zip # Adjust php.ini settings -if [[ "$1" == "8.5" ]]; then - sudo bash -c "echo 'register_argc_argv = On' >> /etc/php/$1/cli/php.ini" -else - sudo bash -c "echo 'opcache.enable = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini" - sudo bash -c "echo 'opcache.enable_cli = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini" - sudo bash -c "echo 'opcache.jit = tracing' >> /etc/php/$1/cli/conf.d/10-opcache.ini" - sudo bash -c "echo 'opcache.jit_buffer_size = 128M' >> /etc/php/$1/cli/conf.d/10-opcache.ini" -fi +sudo bash -c "echo 'register_argc_argv = On' >> /etc/php/$1/cli/php.ini" +sudo bash -c "echo 'opcache.enable = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini" +sudo bash -c "echo 'opcache.enable_cli = 1' >> /etc/php/$1/cli/conf.d/10-opcache.ini" +sudo bash -c "echo 'opcache.jit = tracing' >> /etc/php/$1/cli/conf.d/10-opcache.ini" +sudo bash -c "echo 'opcache.jit_buffer_size = 128M' >> /etc/php/$1/cli/conf.d/10-opcache.ini" # Enable APCu if [ -f "/etc/php/$1/cli/conf.d/20-apcu.ini" ]; then From 385067b005590c14f8f83fbda765369c9f476a5c Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sat, 22 Nov 2025 21:47:25 +0900 Subject: [PATCH 15/34] Convert outdated