+++ /dev/null
-<?php
-namespace TYPO3\CMS\Core\Compatibility;
-
-/*
- * 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!
- */
-
-use TYPO3\CMS\Core\Core\Environment;
-use TYPO3\CMS\Core\Package\PackageInterface;
-
-/**
- * Class to simulate the "old" extension information array element
- *
- * @internal
- */
-class LoadedExtensionArrayElement implements \IteratorAggregate, \ArrayAccess, \Serializable, \Countable
-{
- /**
- * @var PackageInterface Instance of package manager
- */
- protected $package;
-
- /**
- * @var array List of relevant extension files
- */
- protected $extensionFilesToCheckFor = [
- 'ext_localconf.php',
- 'ext_tables.php',
- 'ext_tables.sql',
- 'ext_tables_static+adt.sql',
- 'ext_typoscript_constants.typoscript',
- 'ext_typoscript_setup.typoscript',
- 'ext_typoscript_constants.txt',
- 'ext_typoscript_setup.txt'
- ];
-
- /**
- * @var array Final extension information
- */
- protected $extensionInformation = [];
-
- /**
- * Constructor builds compatibility API
- *
- * @param PackageInterface $package
- */
- public function __construct(PackageInterface $package)
- {
- $this->package = $package;
- $this->initializeBasicExtensionInformation();
- $this->initializeExtensionFiles();
- $this->initializeExtensionIcon();
- }
-
- /**
- * Create main information
- */
- protected function initializeBasicExtensionInformation()
- {
- $pathSite = Environment::getPublicPath() . '/';
- $pathSiteLength = strlen($pathSite);
- $absolutePackagePath = $this->package->getPackagePath();
- if (strpos($absolutePackagePath, $pathSite) === 0) {
- $relativePackagePathToPathSite = substr($absolutePackagePath, $pathSiteLength);
- $relativePackagePathToPathSiteSegments = explode('/', $relativePackagePathToPathSite);
- $packageType = null;
- // Determine if extension is installed locally, globally or system (in this order)
- switch (implode('/', array_slice($relativePackagePathToPathSiteSegments, 0, 2))) {
- case 'typo3conf/ext':
- $packageType = 'L';
- break;
- case TYPO3_mainDir . 'ext':
- $packageType = 'G';
- break;
- case TYPO3_mainDir . 'sysext':
- $packageType = 'S';
- break;
- case 'typo3temp/var/tests/test_ext':
- $packageType = 'T';
- break;
- }
- if ($packageType !== null) {
- $this->extensionInformation['type'] = $packageType;
- }
- }
- }
-
- /**
- * Initialize extension icon
- */
- protected function initializeExtensionIcon()
- {
- $this->extensionInformation['ext_icon'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionIcon($this->package->getPackagePath());
- }
-
- /**
- * Register found files in extension array if extension was found
- */
- protected function initializeExtensionFiles()
- {
- foreach ($this->extensionFilesToCheckFor as $fileName) {
- $absolutePathToFile = $this->package->getPackagePath() . $fileName;
- if (@file_exists($absolutePathToFile)) {
- $this->extensionInformation[$fileName] = $absolutePathToFile;
- }
- }
- }
-
- /**
- * Retrieve an external iterator
- *
- * @link http://php.net/manual/en/iteratoraggregate.getiterator.php
- * @return \Traversable An instance of an object implementing Iterator or Traversable
- */
- public function getIterator()
- {
- return new \ArrayIterator($this->extensionInformation);
- }
-
- /**
- * Whether an offset exists
- *
- * @link http://php.net/manual/en/arrayaccess.offsetexists.php
- * @param mixed $offset An offset to check for.
- * @return bool TRUE on success or FALSE on failure.
- */
- public function offsetExists($offset)
- {
- return isset($this->extensionInformation[$offset]);
- }
-
- /**
- * Offset to retrieve
- *
- * @link http://php.net/manual/en/arrayaccess.offsetget.php
- * @param mixed $offset The offset to retrieve.
- * @return mixed Can return all value types.
- */
- public function offsetGet($offset)
- {
- return $this->extensionInformation[$offset];
- }
-
- /**
- * Offset to set
- *
- * @link http://php.net/manual/en/arrayaccess.offsetset.php
- * @param mixed $offset The offset to assign the value to.
- * @param mixed $value The value to set.
- * @throws \InvalidArgumentException
- */
- public function offsetSet($offset, $value)
- {
- throw new \InvalidArgumentException('The array $GLOBALS[\'TYPO3_LOADED_EXT\'] may not be modified.', 1361915115);
- }
-
- /**
- * Offset to unset
- *
- * @link http://php.net/manual/en/arrayaccess.offsetunset.php
- * @param mixed $offset The offset to unset.
- * @throws \InvalidArgumentException
- */
- public function offsetUnset($offset)
- {
- throw new \InvalidArgumentException('The array $GLOBALS[\'TYPO3_LOADED_EXT\'] may not be modified.', 1361915206);
- }
-
- /**
- * String representation of object
- *
- * @link http://php.net/manual/en/serializable.serialize.php
- * @return string the string representation of the object or null
- */
- public function serialize()
- {
- return serialize($this->extensionInformation);
- }
-
- /**
- * Constructs the object
- *
- * @link http://php.net/manual/en/serializable.unserialize.php
- * @param string $serialized The string representation of the object.
- * @return mixed the original value unserialized.
- */
- public function unserialize($serialized)
- {
- $this->extensionInformation = unserialize($serialized);
- }
-
- /**
- * Count elements of an object
- *
- * @link http://php.net/manual/en/countable.count.php
- * @return int The custom count as an integer. The return value is cast to an integer.
- */
- public function count()
- {
- return count($this->extensionInformation);
- }
-
- /**
- * @return array
- */
- public function toArray()
- {
- return iterator_to_array($this);
- }
-}
+++ /dev/null
-<?php
-namespace TYPO3\CMS\Core\Compatibility;
-
-/*
- * 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!
- */
-
-/**
- * Class to simulate the "old" extension information array
- *
- * @internal
- */
-class LoadedExtensionsArray implements \Iterator, \ArrayAccess, \Serializable, \Countable
-{
- /**
- * @var \TYPO3\CMS\Core\Package\PackageManager Instance of package manager
- */
- protected $packageManager;
-
- /**
- * @var array Loaded element cache
- */
- protected $loadedExtensionArrayElementCache = [];
-
- /**
- * @var string Pointer to current position
- */
- protected $iteratorPosition;
-
- /**
- * @param \TYPO3\CMS\Core\Package\PackageManager $packageManager
- */
- public function __construct(\TYPO3\CMS\Core\Package\PackageManager $packageManager)
- {
- $this->packageManager = $packageManager;
- }
-
- /**
- * Whether an offset exists
- *
- * @link http://php.net/manual/en/arrayaccess.offsetexists.php
- * @param mixed $offset An offset to check for.
- * @return bool TRUE on success or FALSE on failure.
- */
- public function offsetExists($offset)
- {
- return $this->packageManager->isPackageActive($offset);
- }
-
- /**
- * Offset to retrieve
- *
- * @link http://php.net/manual/en/arrayaccess.offsetget.php
- * @param mixed $offset The offset to retrieve.
- * @return mixed Can return all value types.
- */
- public function offsetGet($offset)
- {
- // Pass it through the package manager, as it resolves package aliases
- $package = $this->packageManager->getPackage($offset);
- $packageKey = $package->getPackageKey();
- if (!isset($this->loadedExtensionArrayElementCache[$packageKey])) {
- $this->loadedExtensionArrayElementCache[$packageKey] = new LoadedExtensionArrayElement($package);
- }
- return $this->loadedExtensionArrayElementCache[$packageKey];
- }
-
- /**
- * Offset to set
- *
- * @link http://php.net/manual/en/arrayaccess.offsetset.php
- * @param mixed $offset The offset to assign the value to.
- * @param mixed $value The value to set.
- * @throws \InvalidArgumentException
- */
- public function offsetSet($offset, $value)
- {
- throw new \InvalidArgumentException('The array $GLOBALS[\'TYPO3_LOADED_EXT\'] may not be modified.', 1361915596);
- }
-
- /**
- * Offset to unset
- *
- * @link http://php.net/manual/en/arrayaccess.offsetunset.php
- * @param mixed $offset The offset to unset.
- * @throws \InvalidArgumentException
- */
- public function offsetUnset($offset)
- {
- throw new \InvalidArgumentException('The array $GLOBALS[\'TYPO3_LOADED_EXT\'] may not be modified.', 1361915610);
- }
-
- /**
- * String representation of object
- *
- * @link http://php.net/manual/en/serializable.serialize.php
- * @return string the string representation of the object or null
- */
- public function serialize()
- {
- return serialize($this->loadedExtensionArrayElementCache);
- }
-
- /**
- * Constructs the object
- *
- * @link http://php.net/manual/en/serializable.unserialize.php
- * @param string $serialized The string representation of the object.
- * @return mixed the original value unserialized.
- */
- public function unserialize($serialized)
- {
- $this->loadedExtensionArrayElementCache = unserialize($serialized);
- }
-
- /**
- * Count elements of an object
- *
- * @link http://php.net/manual/en/countable.count.php
- * @return int The custom count as an integer.
- */
- public function count()
- {
- return count($this->packageManager->getActivePackages());
- }
-
- /**
- * Return the current element
- *
- * @link http://php.net/manual/en/iterator.current.php
- * @return mixed Can return any type.
- */
- public function current()
- {
- return $this->offsetGet($this->iteratorPosition);
- }
-
- /**
- * Move forward to next element
- *
- * @link http://php.net/manual/en/iterator.next.php
- */
- public function next()
- {
- $packageKeys = array_keys($this->packageManager->getActivePackages());
- $position = array_search($this->iteratorPosition, $packageKeys);
- if (isset($packageKeys[$position + 1])) {
- $this->iteratorPosition = $packageKeys[$position + 1];
- } else {
- $this->iteratorPosition = null;
- }
- }
-
- /**
- * Return the key of the current element
- *
- * @link http://php.net/manual/en/iterator.key.php
- * @return mixed scalar on success, or null on failure.
- */
- public function key()
- {
- return $this->iteratorPosition;
- }
-
- /**
- * Checks if current position is valid
- *
- * @link http://php.net/manual/en/iterator.valid.php
- * @return bool The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.
- */
- public function valid()
- {
- return $this->offsetExists($this->iteratorPosition);
- }
-
- /**
- * Rewind the Iterator to the first element
- *
- * @link http://php.net/manual/en/iterator.rewind.php
- */
- public function rewind()
- {
- $keys = array_keys($this->packageManager->getActivePackages());
- $this->iteratorPosition = array_shift($keys);
- }
-
- /**
- * Reset
- */
- public function reset()
- {
- $this->loadedExtensionArrayElementCache = [];
- $this->rewind();
- }
-
- /**
- * Whether package manager is set in class
- *
- * @return bool TRUE if package manager is set
- */
- public function hasPackageManager()
- {
- return $this->packageManager !== null;
- }
-
- /**
- * @return array
- */
- public function toArray()
- {
- return array_map(
- function ($loadedExtElement) {
- return $loadedExtElement->toArray();
- },
- iterator_to_array($this)
- );
- }
-}
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
-use TYPO3\CMS\Core\Compatibility\LoadedExtensionArrayElement;
use TYPO3\CMS\Core\Core\ClassLoadingInformation;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Service\DependencyOrderingService;
} catch (Exception\PackageManagerCacheUnavailableException $exception) {
$this->loadPackageStates();
$this->initializePackageObjects();
- // @deprecated will be removed in TYPO3 v10.0
- $this->initializeCompatibilityLoadedExtArray();
$this->saveToPackageCache();
}
}
$packageCache = [
'packageStatesConfiguration' => $this->packageStatesConfiguration,
'packageAliasMap' => $this->packageAliasMap,
- // @deprecated will be removed in TYPO3 v10.0
- 'loadedExtArray' => $GLOBALS['TYPO3_LOADED_EXT'],
'composerNameToPackageKeyMap' => $this->composerNameToPackageKeyMap,
'packageObjects' => serialize($this->packages),
];
\stdClass::class,
]
]);
- // @deprecated will be removed in TYPO3 v10.0
- $GLOBALS['TYPO3_LOADED_EXT'] = $packageCache['loadedExtArray'];
}
/**
$this->packageStatesConfiguration['packages'][$package->getPackageKey()] = ['packagePath' => str_replace($this->packagesBasePath, '', $package->getPackagePath())];
}
- /**
- * Initializes a backwards compatibility $GLOBALS['TYPO3_LOADED_EXT'] array
- */
- protected function initializeCompatibilityLoadedExtArray()
- {
- // @deprecated will be removed in TYPO3 v10.0
- $loadedExtObj = new \TYPO3\CMS\Core\Compatibility\LoadedExtensionsArray($this);
- $GLOBALS['TYPO3_LOADED_EXT'] = $loadedExtObj->toArray();
- }
-
/**
* Scans all directories in the packages directories for available packages.
* For each package a Package object is created and stored in $this->packages.
{
$package = $this->registerPackageDuringRuntime($packageKey);
$this->runtimeActivatedPackages[$package->getPackageKey()] = $package;
- // @deprecated will be removed in TYPO3 v10.0
- if (!isset($GLOBALS['TYPO3_LOADED_EXT'][$package->getPackageKey()])) {
- $loadedExtArrayElement = new LoadedExtensionArrayElement($package);
- $GLOBALS['TYPO3_LOADED_EXT'][$package->getPackageKey()] = $loadedExtArrayElement->toArray();
- }
$this->registerTransientClassLoadingInformationForPackage($package);
}
$packageStatesCode = "<?php\n$fileDescription\nreturn " . ArrayUtility::arrayExport($this->packageStatesConfiguration) . ";\n";
GeneralUtility::writeFile($this->packageStatesPathAndFilename, $packageStatesCode, true);
- // @deprecated will be removed in TYPO3 v10.0
- $this->initializeCompatibilityLoadedExtArray();
-
GeneralUtility::makeInstance(OpcodeCacheService::class)->clearAllActive($this->packageStatesPathAndFilename);
}
* :php:`EXT:saltedpasswords/Resources/Private/Language/locallang_em.xlf`
+The following global variables have been removed:
+
+* :php:`$GLOBALS['TYPO3_LOADED_EXT']`
+
Impact
======
'$GLOBALS[\'TYPO3_LOADED_EXT\']' => [
'restFiles' => [
'Deprecation-86404-GLOBALSTYPO3_LOADED_EXT.rst',
+ 'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
],
],
];
'type' => 'global',
'globalKey' => 'TCA_DESCR',
],
- // @deprecated will be removed in TYPO3 v10.0
- 'loadedExt' => [
- 'label' => 'loadedExt',
- 'type' => 'global',
- 'globalKey' => 'TYPO3_LOADED_EXT',
- ],
'services' => [
'label' => 't3services',
'key' => 'services',
<trans-unit id="tcaDescr">
<source>$GLOBALS['TCA_DESCR'] (Table Help Description)</source>
</trans-unit>
- <trans-unit id="loadedExt">
- <source>$GLOBALS['TYPO3_LOADED_EXT'] (Loaded Extensions)</source>
- </trans-unit>
<trans-unit id="tbeStyles">
<source>$GLOBALS['TBE_STYLES'] (Skinning Styles)</source>
</trans-unit>