[!!!][TASK] Remove deprecated constants and runtime activated packages 84/64584/5 master
authorBenni Mack <benni@typo3.org>
Tue, 26 May 2020 14:31:51 +0000 (16:31 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 26 May 2020 20:31:02 +0000 (22:31 +0200)
This change removes the unneeded public constants

- FILE_DENY_PATTERN_DEFAULT
- PHP_EXTENSIONS_DEFAULT
- TYPO3_copyright_year
- TYPO3_URL_DONATE
- TYPO3_URL_EXCEPTION
- TYPO3_URL_GENERAL
- TYPO3_URL_LICENSE
- TYPO3_URL_WIKI_OPCODECACHE

as well as the runtimeActivatedPackages feature, all of which have
been marked as deprecated in TYPO3 v10.

Resolves: #91477
Related: #91473
Releases: master
Change-Id: I8e98509e2842d7fb116f44c31d4c10957b73a2ca
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64584
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Package/PackageManager.php
typo3/sysext/core/Documentation/Changelog/master/Breaking-91473-DeprecatedFunctionalityRemoved.rst
typo3/sysext/core/Tests/Functional/Package/RuntimeActivatedPackagesTest.php [deleted file]
typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php
typo3/sysext/install/Configuration/ExtensionScanner/Php/ConstantMatcher.php

index 92f335e..0370c93 100644 (file)
@@ -111,7 +111,6 @@ class Bootstrap
         // singleton instance is required by PackageManager->activePackageDuringRuntime
         GeneralUtility::setSingletonInstance(PackageManager::class, $packageManager);
         ExtensionManagementUtility::setPackageManager($packageManager);
-        static::initializeRuntimeActivatedPackagesFromConfiguration($packageManager);
 
         static::setDefaultTimezone();
         static::setMemoryLimit();
@@ -251,23 +250,6 @@ class Bootstrap
     }
 
     /**
-     * Activates a package during runtime. This is used in AdditionalConfiguration.php
-     * to enable extensions under conditions.
-     *
-     * @param PackageManager $packageManager
-     */
-    protected static function initializeRuntimeActivatedPackagesFromConfiguration(PackageManager $packageManager)
-    {
-        $packages = $GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages'] ?? [];
-        if (!empty($packages)) {
-            trigger_error('Support for runtime activated packages will be removed in TYPO3 v11.0.', E_USER_DEPRECATED);
-            foreach ($packages as $runtimeAddedPackageKey) {
-                $packageManager->activatePackageDuringRuntime($runtimeAddedPackageKey);
-            }
-        }
-    }
-
-    /**
      * Load ext_localconf of extensions
      *
      * @param bool $allowCaching
index d4a48c4..4862b7e 100644 (file)
@@ -15,7 +15,6 @@
 
 namespace TYPO3\CMS\Core\Core;
 
-use TYPO3\CMS\Core\Resource\Security\FileNameValidator;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\PathUtility;
 
@@ -92,13 +91,6 @@ class SystemEnvironmentBuilder
      */
     protected static function defineBaseConstants()
     {
-        // Check one of the constants and return early if already defined,
-        // needed if multiple requests are handled in one process, for instance in functional testing.
-        // This check can be removed in TYPO3 v11.0.
-        if (defined('FILE_DENY_PATTERN_DEFAULT')) {
-            return;
-        }
-
         // A linefeed, a carriage return, a CR-LF combination
         defined('LF') ?: define('LF', chr(10));
         defined('CR') ?: define('CR', chr(13));
@@ -108,39 +100,6 @@ class SystemEnvironmentBuilder
         if (!defined('TYPO3_mainDir')) {
             define('TYPO3_mainDir', 'typo3/');
         }
-
-        /**
-         * @deprecated use FileNameAccess class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('FILE_DENY_PATTERN_DEFAULT', FileNameValidator::DEFAULT_FILE_DENY_PATTERN);
-        /**
-         * @deprecated use FILE_DENY_PATTERN and FileNameAccess class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('PHP_EXTENSIONS_DEFAULT', 'php,php3,php4,php5,php6,php7,php8,phpsh,inc,phtml,pht,phar');
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_copyright_year', '1998-' . date('Y'));
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_URL_GENERAL', 'https://typo3.org/');
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_URL_LICENSE', 'https://typo3.org/typo3-cms/overview/licenses/');
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_URL_EXCEPTION', 'https://typo3.org/go/exception/CMS/');
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_URL_DONATE', 'https://typo3.org/community/contribute/donate/');
-        /**
-         * @deprecated use Typo3Information class to retrieve this information, will be removed in TYPO3 v11.0
-         */
-        define('TYPO3_URL_WIKI_OPCODECACHE', 'https://wiki.typo3.org/Opcode_Cache');
     }
 
     /**
index 6934849..8643aad 100644 (file)
@@ -71,11 +71,6 @@ class PackageManager implements SingletonInterface
     protected $packageAliasMap = [];
 
     /**
-     * @var array
-     */
-    protected $runtimeActivatedPackages = [];
-
-    /**
      * Absolute path leading to the various package directories
      * @var string
      */
@@ -316,26 +311,6 @@ class PackageManager implements SingletonInterface
     }
 
     /**
-     * Scans all directories for a certain package.
-     *
-     * @param string $packageKey
-     * @return PackageInterface
-     * @deprecated will be removed in TYPO3 v11.0
-     */
-    protected function registerPackageDuringRuntime($packageKey)
-    {
-        $packagePaths = $this->scanPackagePathsForExtensions();
-        $packagePath = $packagePaths[$packageKey];
-        $composerManifest = $this->getComposerManifest($packagePath);
-        $packageKey = $this->getPackageKeyFromManifest($composerManifest, $packagePath);
-        $this->composerNameToPackageKeyMap[strtolower($composerManifest->name)] = $packageKey;
-        $packagePath = PathUtility::sanitizeTrailingSeparator($packagePath);
-        $package = new Package($this, $packageKey, $packagePath);
-        $this->registerPackage($package);
-        return $package;
-    }
-
-    /**
      * Fetches all directories from sysext/global/local locations and checks if the extension contains an ext_emconf.php
      *
      * @return array
@@ -520,7 +495,7 @@ class PackageManager implements SingletonInterface
     {
         $packageKey = $this->getPackageKeyFromComposerName($packageKey);
 
-        return isset($this->runtimeActivatedPackages[$packageKey]) || isset($this->packageStatesConfiguration['packages'][$packageKey]);
+        return isset($this->packageStatesConfiguration['packages'][$packageKey]);
     }
 
     /**
@@ -577,19 +552,6 @@ class PackageManager implements SingletonInterface
     }
 
     /**
-     * Enables packages during runtime, but no class aliases will be available
-     *
-     * @param string $packageKey
-     * @deprecated will be removed in TYPO3 v11.0
-     */
-    public function activatePackageDuringRuntime($packageKey)
-    {
-        $package = $this->registerPackageDuringRuntime($packageKey);
-        $this->runtimeActivatedPackages[$package->getPackageKey()] = $package;
-        $this->registerTransientClassLoadingInformationForPackage($package);
-    }
-
-    /**
      * @param PackageInterface $package
      * @throws \TYPO3\CMS\Core\Exception
      */
@@ -638,7 +600,7 @@ class PackageManager implements SingletonInterface
     /**
      * Returns an array of \TYPO3\CMS\Core\Package objects of all active packages.
      * A package is active, if it is available and has been activated in the package
-     * manager settings. This method returns runtime activated packages too
+     * manager settings.
      *
      * @return PackageInterface[]
      */
@@ -651,7 +613,7 @@ class PackageManager implements SingletonInterface
                 }
             }
         }
-        return array_merge($this->activePackages, $this->runtimeActivatedPackages);
+        return $this->activePackages;
     }
 
     /**
index b0c1750..3f15acb 100644 (file)
@@ -47,6 +47,15 @@ The following TypoScript options have been dropped:
 
 The following constants have been dropped:
 
+- :php:`FILE_DENY_PATTERN_DEFAULT`
+- :php:`PHP_EXTENSIONS_DEFAULT`
+- :php:`TYPO3_copyright_year`
+- :php:`TYPO3_URL_DONATE`
+- :php:`TYPO3_URL_EXCEPTION`
+- :php:`TYPO3_URL_GENERAL`
+- :php:`TYPO3_URL_LICENSE`
+- :php:`TYPO3_URL_WIKI_OPCODECACHE`
+
 The following class constants have been dropped:
 
 - :php:`\TYPO3\CMS\Core\Tree\TableConfiguration\DatabaseTreeDataProvider::SIGNAL_PostProcessTreeData`
@@ -91,6 +100,8 @@ The following class constants have been set to protected:
 
 The following global options are ignored:
 
+- :php:`$GLOBALS['TYPO3_CONF_VARS']['EXT']['runtimeActivatedPackages']`
+
 The following language files and aliases have been removed:
 
 The following global variables have been removed:
diff --git a/typo3/sysext/core/Tests/Functional/Package/RuntimeActivatedPackagesTest.php b/typo3/sysext/core/Tests/Functional/Package/RuntimeActivatedPackagesTest.php
deleted file mode 100644 (file)
index 97d7829..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-namespace TYPO3\CMS\Core\Tests\Functional\Package;
-
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-
-/**
- * Test case
- */
-class RuntimeActivatedPackagesTest extends FunctionalTestCase
-{
-    protected $configurationToUseInTestInstance = [
-        'EXT' => [
-            'runtimeActivatedPackages' => [
-                'felogin'
-            ]
-        ]
-    ];
-
-    /**
-     * @test
-     */
-    public function runtimeActivatedPackageIsLoaded()
-    {
-        self::assertTrue(ExtensionManagementUtility::isLoaded('felogin'));
-    }
-}
index e5c1d8d..58a0d6a 100644 (file)
@@ -39,35 +39,6 @@ class SystemEnvironmentBuilderTest extends UnitTestCase
     }
 
     /**
-     * Data provider for 'fileDenyPatternMatchesPhpExtension' test case.
-     *
-     * @return array
-     */
-    public function fileDenyPatternMatchesPhpExtensionDataProvider()
-    {
-        $fileName = StringUtility::getUniqueId('filename');
-        $data = [];
-        $phpExtensions = ['php', 'php3', 'php4', 'php5', 'php7', 'phpsh', 'phtml', 'pht'];
-        foreach ($phpExtensions as $extension) {
-            $data[] = [$fileName . '.' . $extension];
-            $data[] = [$fileName . '.' . $extension . '.txt'];
-        }
-        return $data;
-    }
-
-    /**
-     * Tests whether an accordant PHP extension is denied.
-     *
-     * @test
-     * @dataProvider fileDenyPatternMatchesPhpExtensionDataProvider
-     * @param string $phpExtension
-     */
-    public function fileDenyPatternMatchesPhpExtension($phpExtension)
-    {
-        self::assertGreaterThan(0, preg_match('/' . FILE_DENY_PATTERN_DEFAULT . '/', $phpExtension), $phpExtension);
-    }
-
-    /**
      * @test
      */
     public function getPathThisScriptCliReadsLocalPartFromArgv()
index d48d251..f580df1 100644 (file)
@@ -193,42 +193,50 @@ return [
     ],
     'TYPO3_copyright_year' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'TYPO3_URL_GENERAL' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'TYPO3_URL_LICENSE' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'TYPO3_URL_EXCEPTION' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'TYPO3_URL_DONATE' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'TYPO3_URL_WIKI_OPCODECACHE' => [
         'restFiles' => [
-            'Deprecation-89866-Global-TYPO3-information-related-constants.rst'
+            'Deprecation-89866-Global-TYPO3-information-related-constants.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'FILE_DENY_PATTERN_DEFAULT' => [
         'restFiles' => [
-            'Deprecation-90147-UnifiedFileNameValidator.rst'
+            'Deprecation-90147-UnifiedFileNameValidator.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
     'PHP_EXTENSIONS_DEFAULT' => [
         'restFiles' => [
-            'Deprecation-90147-UnifiedFileNameValidator.rst'
+            'Deprecation-90147-UnifiedFileNameValidator.rst',
+            'Breaking-91473-DeprecatedFunctionalityRemoved.rst'
         ]
     ],
 ];