From 8e575af25eaa43a53bd5449c3e6d4627c501286c Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Sat, 12 Oct 2024 14:46:03 +0200 Subject: [PATCH 01/10] Move CMS Filesystem package to compat plugin --- plugins/behaviour/compat/src/Extension/Compat.php | 2 ++ .../behaviour/compat/src/classes}/Filesystem/File.php | 0 .../compat/src/classes}/Filesystem/FilesystemHelper.php | 0 .../behaviour/compat/src/classes}/Filesystem/Folder.php | 0 .../Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini | 0 .../behaviour/compat/src/classes}/Filesystem/Patcher.php | 0 .../behaviour/compat/src/classes}/Filesystem/Path.php | 0 .../behaviour/compat/src/classes}/Filesystem/Stream.php | 0 .../compat/src/classes}/Filesystem/Streams/StreamString.php | 0 .../compat/src/classes}/Filesystem/Support/StringController.php | 0 10 files changed, 2 insertions(+) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/File.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/FilesystemHelper.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Folder.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Patcher.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Path.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Stream.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Streams/StreamString.php (100%) rename {libraries/src => plugins/behaviour/compat/src/classes}/Filesystem/Support/StringController.php (100%) diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index 7232a8866269a..7861b9ee68728 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -74,6 +74,8 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) if ($this->params->get('classes_aliases', '1')) { require_once \dirname(__DIR__) . '/classmap/classmap.php'; } + + \JLoader::registerNamespace('\\Joomla\\CMS', JPATH_PLUGINS . '/behaviour/compat/src/classes'); } /** diff --git a/libraries/src/Filesystem/File.php b/plugins/behaviour/compat/src/classes/Filesystem/File.php similarity index 100% rename from libraries/src/Filesystem/File.php rename to plugins/behaviour/compat/src/classes/Filesystem/File.php diff --git a/libraries/src/Filesystem/FilesystemHelper.php b/plugins/behaviour/compat/src/classes/Filesystem/FilesystemHelper.php similarity index 100% rename from libraries/src/Filesystem/FilesystemHelper.php rename to plugins/behaviour/compat/src/classes/Filesystem/FilesystemHelper.php diff --git a/libraries/src/Filesystem/Folder.php b/plugins/behaviour/compat/src/classes/Filesystem/Folder.php similarity index 100% rename from libraries/src/Filesystem/Folder.php rename to plugins/behaviour/compat/src/classes/Filesystem/Folder.php diff --git a/libraries/src/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini b/plugins/behaviour/compat/src/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini similarity index 100% rename from libraries/src/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini rename to plugins/behaviour/compat/src/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini diff --git a/libraries/src/Filesystem/Patcher.php b/plugins/behaviour/compat/src/classes/Filesystem/Patcher.php similarity index 100% rename from libraries/src/Filesystem/Patcher.php rename to plugins/behaviour/compat/src/classes/Filesystem/Patcher.php diff --git a/libraries/src/Filesystem/Path.php b/plugins/behaviour/compat/src/classes/Filesystem/Path.php similarity index 100% rename from libraries/src/Filesystem/Path.php rename to plugins/behaviour/compat/src/classes/Filesystem/Path.php diff --git a/libraries/src/Filesystem/Stream.php b/plugins/behaviour/compat/src/classes/Filesystem/Stream.php similarity index 100% rename from libraries/src/Filesystem/Stream.php rename to plugins/behaviour/compat/src/classes/Filesystem/Stream.php diff --git a/libraries/src/Filesystem/Streams/StreamString.php b/plugins/behaviour/compat/src/classes/Filesystem/Streams/StreamString.php similarity index 100% rename from libraries/src/Filesystem/Streams/StreamString.php rename to plugins/behaviour/compat/src/classes/Filesystem/Streams/StreamString.php diff --git a/libraries/src/Filesystem/Support/StringController.php b/plugins/behaviour/compat/src/classes/Filesystem/Support/StringController.php similarity index 100% rename from libraries/src/Filesystem/Support/StringController.php rename to plugins/behaviour/compat/src/classes/Filesystem/Support/StringController.php From 6c149f06e4532815d46b2e6b669ac2673421833d Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Sat, 12 Oct 2024 15:44:25 +0200 Subject: [PATCH 02/10] Fixing codestyle checker --- ruleset.xml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ruleset.xml b/ruleset.xml index dbe75cebc35d8..f7d6cf4947fa1 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -9,6 +9,7 @@ ^cache/* ^media/* ^node_modules/* + ^plugins/behaviour/compat/src/classes/* ^tmp/* @@ -131,8 +132,6 @@ administrator/components/com_users/src/Service/HTML/Users\.php components/com_content/helpers/icon\.php components/com_content/helpers/icon\.php - libraries/src/Filesystem/Stream\.php - libraries/src/Filesystem/Streams/StreamString\.php libraries/src/Installer/Adapter/ComponentAdapter\.php libraries/src/Installer/Adapter/LanguageAdapter\.php libraries/src/Installer/Adapter/ModuleAdapter\.php @@ -204,9 +203,6 @@ libraries/src/Encrypt/Base32\.php libraries/src/Environment/Browser\.php libraries/src/Feed/FeedFactory\.php - libraries/src/Filesystem/Folder\.php - libraries/src/Filesystem/Stream\.php - libraries/src/Filesystem/Support/StringController\.php libraries/src/HTML/Helpers/Grid\.php libraries/src/Installer/Adapter/ComponentAdapter\.php libraries/src/Installer/Adapter/LanguageAdapter\.php @@ -246,8 +242,6 @@ administrator/components/com_installer/src/Model/DatabaseModel\.php libraries/src/Client/FtpClient\.php - libraries/src/Filesystem/Path\.php - libraries/src/Filesystem/Streams/StreamString\.php index\.php From 770e5d1faf535549504e5414908e84e20a04afa1 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Mon, 14 Oct 2024 10:20:39 +0200 Subject: [PATCH 03/10] Add option and move files around --- .../language/en-GB/plg_behaviour_compat.ini | 2 ++ .../compat/{src => }/classes/Filesystem/File.php | 0 .../classes/Filesystem/FilesystemHelper.php | 0 .../compat/{src => }/classes/Filesystem/Folder.php | 0 .../en-GB/en-GB.lib_joomla_filesystem_patcher.ini | 0 .../compat/{src => }/classes/Filesystem/Patcher.php | 0 .../compat/{src => }/classes/Filesystem/Path.php | 0 .../compat/{src => }/classes/Filesystem/Stream.php | 0 .../classes/Filesystem/Streams/StreamString.php | 0 .../classes/Filesystem/Support/StringController.php | 0 plugins/behaviour/compat/compat.xml | 12 ++++++++++++ plugins/behaviour/compat/src/Extension/Compat.php | 11 ++++++++++- 12 files changed, 24 insertions(+), 1 deletion(-) rename plugins/behaviour/compat/{src => }/classes/Filesystem/File.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/FilesystemHelper.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Folder.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Patcher.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Path.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Stream.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Streams/StreamString.php (100%) rename plugins/behaviour/compat/{src => }/classes/Filesystem/Support/StringController.php (100%) diff --git a/administrator/language/en-GB/plg_behaviour_compat.ini b/administrator/language/en-GB/plg_behaviour_compat.ini index 3dfab0d6abd68..28e45d712c7b7 100644 --- a/administrator/language/en-GB/plg_behaviour_compat.ini +++ b/administrator/language/en-GB/plg_behaviour_compat.ini @@ -8,6 +8,8 @@ PLG_COMPAT_FIELD_CLASSES_ALIASES_LABEL="Classes Aliases" PLG_COMPAT_FIELD_CLASSES_ALIASES_DESCRIPTION="Add class aliases for classes which have been renamed or moved to a namespace." PLG_COMPAT_FIELD_ES5_ASSETS_DESCRIPTION="Activate this option if your extension requires *.es5 assets which has resulted in an exception. The assets provided are empty but prevent the exception." PLG_COMPAT_FIELD_ES5_ASSETS_LABEL="ES5 Assets" +PLG_COMPAT_FIELD_LEGACY_CLASSES_DESCRIPTION="Activate this option if your extension requires classes deprecated for the current version of Joomla. This includes those removed classes from the folder /plugins/behavior/compat/classes/." +PLG_COMPAT_FIELD_LEGACY_CLASSES_LABEL="Include Deprecated Classes" PLG_COMPAT_FIELD_REMOVED_ASSETS_DESCRIPTION="Activate this option if your extension requires removed assets which has resulted in an exception. The assets provided are empty but prevent the exception." PLG_COMPAT_FIELD_REMOVED_ASSETS_LABEL="Removed Assets" PLG_COMPAT_XML_DESCRIPTION="If you use extensions which are not using the current Joomla Coding standards then this plugin, when enabled, will provide backward compatibility to the prior major version." diff --git a/plugins/behaviour/compat/src/classes/Filesystem/File.php b/plugins/behaviour/compat/classes/Filesystem/File.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/File.php rename to plugins/behaviour/compat/classes/Filesystem/File.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/FilesystemHelper.php b/plugins/behaviour/compat/classes/Filesystem/FilesystemHelper.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/FilesystemHelper.php rename to plugins/behaviour/compat/classes/Filesystem/FilesystemHelper.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Folder.php b/plugins/behaviour/compat/classes/Filesystem/Folder.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Folder.php rename to plugins/behaviour/compat/classes/Filesystem/Folder.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini b/plugins/behaviour/compat/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini rename to plugins/behaviour/compat/classes/Filesystem/Meta/language/en-GB/en-GB.lib_joomla_filesystem_patcher.ini diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Patcher.php b/plugins/behaviour/compat/classes/Filesystem/Patcher.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Patcher.php rename to plugins/behaviour/compat/classes/Filesystem/Patcher.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Path.php b/plugins/behaviour/compat/classes/Filesystem/Path.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Path.php rename to plugins/behaviour/compat/classes/Filesystem/Path.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Stream.php b/plugins/behaviour/compat/classes/Filesystem/Stream.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Stream.php rename to plugins/behaviour/compat/classes/Filesystem/Stream.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Streams/StreamString.php b/plugins/behaviour/compat/classes/Filesystem/Streams/StreamString.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Streams/StreamString.php rename to plugins/behaviour/compat/classes/Filesystem/Streams/StreamString.php diff --git a/plugins/behaviour/compat/src/classes/Filesystem/Support/StringController.php b/plugins/behaviour/compat/classes/Filesystem/Support/StringController.php similarity index 100% rename from plugins/behaviour/compat/src/classes/Filesystem/Support/StringController.php rename to plugins/behaviour/compat/classes/Filesystem/Support/StringController.php diff --git a/plugins/behaviour/compat/compat.xml b/plugins/behaviour/compat/compat.xml index 18be372ba8497..cfef825579940 100644 --- a/plugins/behaviour/compat/compat.xml +++ b/plugins/behaviour/compat/compat.xml @@ -33,6 +33,18 @@ + + + + params->get('legacy_classes', '1')) { + \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem', JPATH_PLUGINS . '/behaviour/compat/src/classes/Filesystem'); + } } /** @@ -110,5 +112,12 @@ public function onAfterInitialiseDocument(AfterInitialiseDocumentEvent $event) ->getRegistry() ->addRegistryFile('media/plg_behaviour_compat/removed.asset.json'); } + + /** + * Include classes which are removed in 7.0 + */ + if ($this->params->get('legacy_classes', '1')) { + \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem\\', JPATH_PLUGINS . '/behaviour/compat/classes/Filesystem'); + } } } From 95fcc1e40e734a43758cd84f8b660c80ff50d42a Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Mon, 14 Oct 2024 10:33:59 +0200 Subject: [PATCH 04/10] Fixing codestyle rules --- ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruleset.xml b/ruleset.xml index f7d6cf4947fa1..ce84c6cedbceb 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -9,7 +9,7 @@ ^cache/* ^media/* ^node_modules/* - ^plugins/behaviour/compat/src/classes/* + ^plugins/behaviour/compat/classes/* ^tmp/* From 9d7f7dd8d41e4669ead5373b0637e4a7224f3dc0 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Mon, 14 Oct 2024 11:08:49 +0200 Subject: [PATCH 05/10] Fixing path --- plugins/behaviour/compat/src/Extension/Compat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index d4b676b4f615c..7acce9897719a 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -76,7 +76,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) } if ($this->params->get('legacy_classes', '1')) { - \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem', JPATH_PLUGINS . '/behaviour/compat/src/classes/Filesystem'); + \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem', JPATH_PLUGINS . '/behaviour/compat/classes/Filesystem'); } } From 80eb0baf408c962000a5ca3cd96663483e6f5ef4 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 21 Nov 2024 20:42:11 +0100 Subject: [PATCH 06/10] Update plugins/behaviour/compat/compat.xml Co-authored-by: jsanders --- plugins/behaviour/compat/compat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/behaviour/compat/compat.xml b/plugins/behaviour/compat/compat.xml index cfef825579940..6394f722dcabc 100644 --- a/plugins/behaviour/compat/compat.xml +++ b/plugins/behaviour/compat/compat.xml @@ -41,7 +41,7 @@ description="PLG_COMPAT_FIELD_LEGACY_CLASSES_DESCRIPTION" default="1" filter="integer" - > + > From 708086affe60a13764312f58b603012b690f0e35 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 21 Nov 2024 20:46:42 +0100 Subject: [PATCH 07/10] Update ruleset.xml --- ruleset.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruleset.xml b/ruleset.xml index ce84c6cedbceb..2a35166baa154 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -9,7 +9,7 @@ ^cache/* ^media/* ^node_modules/* - ^plugins/behaviour/compat/classes/* + ^plugins/behaviour/compat/classes/* ^tmp/* From 350bd4a0cfff2b2e3f6587148e98c64a640b27e9 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 21 Nov 2024 20:54:33 +0100 Subject: [PATCH 08/10] Update Compat.php --- plugins/behaviour/compat/src/Extension/Compat.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index 7acce9897719a..a6aaf6e461a63 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -75,6 +75,9 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) require_once \dirname(__DIR__) . '/classmap/classmap.php'; } + /** + * Include classes which are removed in 7.0 + */ if ($this->params->get('legacy_classes', '1')) { \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem', JPATH_PLUGINS . '/behaviour/compat/classes/Filesystem'); } @@ -112,12 +115,5 @@ public function onAfterInitialiseDocument(AfterInitialiseDocumentEvent $event) ->getRegistry() ->addRegistryFile('media/plg_behaviour_compat/removed.asset.json'); } - - /** - * Include classes which are removed in 7.0 - */ - if ($this->params->get('legacy_classes', '1')) { - \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem\\', JPATH_PLUGINS . '/behaviour/compat/classes/Filesystem'); - } } } From 2fd0c760d31c72714e6fb069079104912b403b73 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Thu, 21 Nov 2024 20:57:05 +0100 Subject: [PATCH 09/10] Update compat.xml --- plugins/behaviour/compat/compat.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/behaviour/compat/compat.xml b/plugins/behaviour/compat/compat.xml index 6394f722dcabc..60a6d3a29909f 100644 --- a/plugins/behaviour/compat/compat.xml +++ b/plugins/behaviour/compat/compat.xml @@ -41,7 +41,7 @@ description="PLG_COMPAT_FIELD_LEGACY_CLASSES_DESCRIPTION" default="1" filter="integer" - > + > From 73894fe359e85759e7866b139703454a0a3a09bf Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Fri, 14 Feb 2025 16:11:45 +0100 Subject: [PATCH 10/10] codestyle --- plugins/behaviour/compat/src/Extension/Compat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/behaviour/compat/src/Extension/Compat.php b/plugins/behaviour/compat/src/Extension/Compat.php index 62e72edf5a867..250b48ec0bd60 100644 --- a/plugins/behaviour/compat/src/Extension/Compat.php +++ b/plugins/behaviour/compat/src/Extension/Compat.php @@ -81,7 +81,7 @@ public function __construct(DispatcherInterface $dispatcher, array $config = []) if ($this->params->get('legacy_classes', '1')) { \JLoader::registerNamespace('\\Joomla\\CMS\\Filesystem', JPATH_PLUGINS . '/behaviour/compat/classes/Filesystem'); } - + /** * Load the constant early as it is used in class files before the class itself is loaded. * @deprecated 4.4.0 will be removed in 7.0