Esempio n. 1
0
 /**
  */
 public function setUp()
 {
     \vfsStreamWrapper::register();
     \vfsStreamWrapper::setRoot(new \vfsStreamDirectory('Test'));
     mkdir('vfs://Test/Packages/Application/Acme.MyApp/Classes/', 0770, TRUE);
     $package1 = new \TYPO3\FLOW3\Package\Package('Acme.MyApp', 'vfs://Test/Packages/Application/Acme.MyApp/');
     mkdir('vfs://Test/Packages/Application/Acme.MyAppAddon/Classes/', 0770, TRUE);
     $package2 = new \TYPO3\FLOW3\Package\Package('Acme.MyAppAddon', 'vfs://Test/Packages/Application/Acme.MyAppAddon/');
     $this->classLoader = new \TYPO3\FLOW3\Core\ClassLoader();
     $this->inject($this->classLoader, 'packagesPath', 'vfs://Test/Packages/');
     $this->classLoader->setPackages(array('Acme.MyApp' => $package1, 'Acme.MyAppAddon' => $package2));
 }
Esempio n. 2
0
 /**
  * Initializes the package manager
  *
  * @param \TYPO3\FLOW3\Core\Bootstrap $bootstrap The current bootstrap
  * @param string $packagesBasePath Absolute path of the Packages directory
  * @param string $packageStatesPathAndFilename
  * @return void
  */
 public function initialize(\TYPO3\FLOW3\Core\Bootstrap $bootstrap, $packagesBasePath = FLOW3_PATH_PACKAGES, $packageStatesPathAndFilename = '')
 {
     $this->bootstrap = $bootstrap;
     $this->packagesBasePath = $packagesBasePath;
     $this->packageStatesPathAndFilename = $packageStatesPathAndFilename === '' ? FLOW3_PATH_CONFIGURATION . 'PackageStates.php' : $packageStatesPathAndFilename;
     $this->loadPackageStates();
     foreach ($this->packages as $packageKey => $package) {
         if ($package->isProtected() || isset($this->packageStatesConfiguration['packages'][$packageKey]['state']) && $this->packageStatesConfiguration['packages'][$packageKey]['state'] === 'active') {
             $this->activePackages[$packageKey] = $package;
         }
     }
     $this->classLoader->setPackages($this->activePackages);
     foreach ($this->activePackages as $package) {
         $package->boot($bootstrap);
     }
 }