예제 #1
0
 /**
  * @test
  * @dataProvider enrichExtensionsWithEmConfInformationDataProvider
  * @param $extensions
  * @param $emConf
  * @param $expectedResult
  * @return void
  */
 public function enrichExtensionsWithEmConfInformation($extensions, $emConf, $expectedResult)
 {
     $this->inject($this->subject, 'extensionRepository', $this->getAccessibleMock(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository::class, array('findOneByExtensionKeyAndVersion', 'findHighestAvailableVersion'), array(), '', FALSE));
     $emConfUtilityMock = $this->getMock(\TYPO3\CMS\Extensionmanager\Utility\EmConfUtility::class);
     $emConfUtilityMock->expects($this->any())->method('includeEmConf')->will($this->returnValue($emConf));
     $this->inject($this->subject, 'emConfUtility', $emConfUtilityMock);
     $this->assertEquals($expectedResult, $this->subject->enrichExtensionsWithEmConfAndTerInformation($extensions));
 }
예제 #2
0
 /**
  * Shows a list of unresolved dependency errors with the possibility to bypass the dependency check
  *
  * @param string $extensionKey
  * @throws ExtensionManagerException
  * @return void
  */
 public function unresolvedDependenciesAction($extensionKey)
 {
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     if (isset($availableExtensions[$extensionKey])) {
         $extensionArray = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation(array($extensionKey => $availableExtensions[$extensionKey]));
         /** @var ExtensionModelUtility $extensionModelUtility */
         $extensionModelUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ExtensionModelUtility');
         $extension = $extensionModelUtility->mapExtensionArrayToModel($extensionArray[$extensionKey]);
     } else {
         throw new ExtensionManagerException('Extension ' . $extensionKey . ' is not available', 1402421007);
     }
     $this->dependencyUtility->checkDependencies($extension);
     $this->view->assign('extension', $extension);
     $this->view->assign('unresolvedDependencies', $this->dependencyUtility->getDependencyErrors());
 }
예제 #3
0
 /**
  * @test
  * @dataProvider enrichExtensionsWithEmConfInformationDataProvider
  * @param $extensions
  * @param $emConf
  * @param $expectedResult
  * @return void
  */
 public function enrichExtensionsWithEmConfInformation($extensions, $emConf, $expectedResult)
 {
     $this->fixture->extensionRepository = $this->getAccessibleMock('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository', array('findOneByExtensionKeyAndVersion'));
     $this->fixture->emConfUtility = $this->getMock('TYPO3\\CMS\\Extensionmanager\\Utility\\EmConfUtility');
     $this->fixture->emConfUtility->expects($this->any())->method('includeEmConf')->will($this->returnValue($emConf));
     $this->assertEquals($expectedResult, $this->fixture->enrichExtensionsWithEmConfAndTerInformation($extensions));
 }
예제 #4
0
 /**
  * Shows list of extensions present in the system
  *
  * @return void
  */
 public function indexAction()
 {
     $this->pageRenderer->addJsFile('../t3lib/js/extjs/notifications.js');
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
     $this->view->assign('extensions', $availableAndInstalledExtensions);
 }
예제 #5
0
 /**
  * Returns all objects of this repository.
  *
  * @return array
  */
 public function findAll()
 {
     if (!count($this->extensions)) {
         $availableExtensions = $this->listUtility->getAvailableExtensions();
         $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
         $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
         foreach ($availableAndInstalledExtensions as $entry) {
             /** @var $extension \TYPO3\CMS\Lang\Domain\Model\Extension */
             $extension = $this->objectManager->create('TYPO3\\CMS\\Lang\\Domain\\Model\\Extension', $entry['key'], $entry['title'], $this->getExtensionIconWithPath($entry));
             $extension->setVersionFromString($entry['version']);
             $this->extensions[$entry['key']] = $extension;
         }
         // Sort the list by extension key
         ksort($this->extensions);
     }
     return $this->extensions;
 }
예제 #6
0
 /**
  * Shows list of extensions present in the system
  *
  * @return void
  */
 public function indexAction()
 {
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
     $this->view->assign('extensions', $availableAndInstalledExtensions);
     $this->handleTriggerArguments();
 }
예제 #7
0
 /**
  * Fetch additional information for an extension key
  *
  * @param string $extensionKey
  * @access private
  * @return array
  * @throws ExtensionManagerException
  */
 public function enrichExtensionWithDetails($extensionKey)
 {
     $extension = $this->getExtensionArray($extensionKey);
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation(array($extensionKey => $extension));
     if (!isset($availableAndInstalledExtensions[$extensionKey])) {
         throw new ExtensionManagerException('Please check your uploaded extension "' . $extensionKey . '". The configuration file "ext_emconf.php" seems to be invalid.', 1391432222);
     }
     return $availableAndInstalledExtensions[$extensionKey];
 }
예제 #8
0
 /**
  * Fetch additional information for an extension key
  *
  * @param string $extensionKey
  * @internal
  * @return mixed
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  */
 public function enrichExtensionWithDetails($extensionKey)
 {
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     if (isset($availableExtensions[$extensionKey])) {
         $extension = $availableExtensions[$extensionKey];
     } else {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Extension ' . $extensionKey . ' is not available', 1342864081);
     }
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation(array($extensionKey => $extension));
     return $availableAndInstalledExtensions[$extensionKey];
 }
예제 #9
0
 /**
  * Fetch additional information for an extension key
  *
  * @param string $extensionKey
  * @access private
  * @return array
  * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
  */
 public function enrichExtensionWithDetails($extensionKey)
 {
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     if (isset($availableExtensions[$extensionKey])) {
         $extension = $availableExtensions[$extensionKey];
     } else {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Extension ' . $extensionKey . ' is not available', 1342864081);
     }
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation(array($extensionKey => $extension));
     if (!isset($availableAndInstalledExtensions[$extensionKey])) {
         throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Please check your uploaded extension "' . $extensionKey . '". The configuration file "ext_emconf.php" seems to be invalid.', 1391432222);
     }
     return $availableAndInstalledExtensions[$extensionKey];
 }
예제 #10
0
 public function findInstalledExtensionsThatDependOnMe($extensionKey)
 {
     $availableExtensions = $this->listUtility->getAvailableExtensions();
     $availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensions($availableExtensions);
     $availableAndInstalledExtensions = $this->listUtility->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
     $dependentExtensions = array();
     foreach ($availableAndInstalledExtensions as $availableAndInstalledExtensionKey => $availableAndInstalledExtension) {
         if (isset($availableAndInstalledExtension['installed']) && $availableAndInstalledExtension['installed'] === TRUE) {
             if (is_array($availableAndInstalledExtension['constraints']) && is_array($availableAndInstalledExtension['constraints']['depends']) && array_key_exists($extensionKey, $availableAndInstalledExtension['constraints']['depends'])) {
                 $dependentExtensions[] = $availableAndInstalledExtensionKey;
             }
         }
     }
     return $dependentExtensions;
 }