Closed joomlapl-bot closed 7 months ago
PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/41326 Poniżej zmiany w oryginale:
PR w związku ze zmianą oryginału https://github.com/joomla/joomla-cms/pull/41326 Poniżej zmiany w oryginale:
Click to expand the diff!
```diff diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 3f5cf6cb4d666..5fb9fae46931c 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -237,6 +237,7 @@ protected function uninstallExtensions() ['type' => 'plugin', 'element' => 'compat', 'folder' => 'system', 'client_id' => 0, 'pre_function' => 'migrateCompatPlugin'], ['type' => 'plugin', 'element' => 'logrotation', 'folder' => 'system', 'client_id' => 0, 'pre_function' => 'migrateLogRotationPlugin'], ['type' => 'plugin', 'element' => 'recaptcha', 'folder' => 'captcha', 'client_id' => 0, 'pre_function' => null], + ['type' => 'plugin', 'element' => 'sessiongc', 'folder' => 'system', 'client_id' => 0, 'pre_function' => 'migrateSessionGCPlugin'], ['type' => 'plugin', 'element' => 'updatenotification', 'folder' => 'system', 'client_id' => 0, 'pre_function' => 'migrateUpdatenotificationPlugin'], ]; @@ -360,6 +361,49 @@ private function migrateLogRotationPlugin($data) $model->save($task); } + /** + * This method is for migration for old updatenotification system plugin migration to task. + * + * @param \stdClass $data Object with the extension's record in the `#__extensions` table + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + private function migrateSessionGCPlugin($data) + { + if (!$data->enabled) { + return; + } + + // Get the plugin parameters + $params = new Registry($data->params); + + /** @var SchedulerComponent $component */ + $component = Factory::getApplication()->bootComponent('com_scheduler'); + + /** @var TaskModel $model */ + $model = $component->getMVCFactory()->createModel('Task', 'Administrator', ['ignore_request' => true]); + $task = [ + 'title' => 'SessionGC', + 'type' => 'session.gc', + 'execution_rules' => [ + 'rule-type' => 'interval-hours', + 'interval-hours' => 24, + 'exec-time' => gmdate('H:i'), + 'exec-day' => gmdate('d'), + ], + 'state' => 1, + 'params' => [ + 'enable_session_gc' => $params->get('enable_session_gc', 1), + 'gc_probability' => $params->get('gc_probability', 1), + 'gc_divisor' => $params->get('gc_divisor', 100), + 'enable_session_metadata_gc' => $params->get('enable_session_metadata_gc', 1), + ], + ]; + $model->save($task); + } + /** * This method is for migration for old updatenotification system plugin migration to task. * diff --git a/administrator/components/com_admin/sql/updates/mysql/5.0.0-2023-09-02.sql b/administrator/components/com_admin/sql/updates/mysql/5.0.0-2023-09-02.sql index 4e74349940933..220f69cf47de2 100644 --- a/administrator/components/com_admin/sql/updates/mysql/5.0.0-2023-09-02.sql +++ b/administrator/components/com_admin/sql/updates/mysql/5.0.0-2023-09-02.sql @@ -2,6 +2,7 @@ INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, ` ('plg_task_deleteactionlogs', 'plugin', 'deleteactionlogs', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_privacyconsent', 'plugin', 'privacyconsent', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_rotatelogs', 'plugin', 'rotatelogs', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), +('plg_task_sessiongc', 'plugin', 'sessiongc', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0); INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES diff --git a/administrator/components/com_admin/sql/updates/postgresql/5.0.0-2023-09-02.sql b/administrator/components/com_admin/sql/updates/postgresql/5.0.0-2023-09-02.sql index 08e8541039d17..42bdee445b720 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/5.0.0-2023-09-02.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/5.0.0-2023-09-02.sql @@ -2,6 +2,7 @@ INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", " ('plg_task_deleteactionlogs', 'plugin', 'deleteactionlogs', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_privacyconsent', 'plugin', 'privacyconsent', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_rotatelogs', 'plugin', 'rotatelogs', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), +('plg_task_sessiongc', 'plugin', 'sessiongc', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0), ('plg_task_updatenotification', 'plugin', 'updatenotification', 'task', 0, 1, 1, 0, 1, '', '{}', '', NULL, NULL, 0, 0); INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES diff --git a/administrator/language/en-GB/plg_system_sessiongc.ini b/administrator/language/en-GB/plg_system_sessiongc.ini deleted file mode 100644 index 092adec836261..0000000000000 --- a/administrator/language/en-GB/plg_system_sessiongc.ini +++ /dev/null @@ -1,15 +0,0 @@ -; Joomla! Project -; (C) 2018 Open Source Matters, Inc.