[TASK] Re-work/simplify copyright header in PHP files - Part 3
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Package / UnitTestPackageManager.php
1 <?php
2 namespace TYPO3\CMS\Core\Package;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 use TYPO3\Flow\Utility\Files;
19
20 /**
21 * This is an intermediate package manager that loads
22 * all extensions that are present in one of the package base paths,
23 * so that the class loader can find the classes of all tests,
24 * whether the according extension is active in the installation itself or not.
25 */
26 class UnitTestPackageManager extends \TYPO3\CMS\Core\Package\PackageManager {
27
28 /**
29 * Initializes the package manager
30 *
31 * @param \TYPO3\CMS\Core\Core\Bootstrap|\TYPO3\Flow\Core\Bootstrap $bootstrap The current bootstrap; Flow Bootstrap is here by intention to keep the PackageManager valid to the interface
32 * @return void
33 */
34 public function initialize(\TYPO3\Flow\Core\Bootstrap $bootstrap) {
35 $this->bootstrap = $bootstrap;
36
37 $this->scanAvailablePackages();
38 $this->activePackages = $this->packages;
39
40 $cacheIdentifier = uniqid();
41 $this->classLoader->setCacheIdentifier($cacheIdentifier)->setPackages($this->activePackages);
42 }
43
44 /**
45 * Overwrite the original method to avoid resolving dependencies (which we do not need)
46 * and saving the PackageStates.php file (which we do not want), when calling scanAvailablePackages()
47 *
48 * @return void
49 */
50 protected function sortAndSavePackageStates() {
51 // Deliberately empty!
52 }
53
54 }