[CLEANUP] Extension Manager code 31/29431/8
authorMarkus Klein <klein.t3@mfc-linz.at>
Sat, 12 Apr 2014 15:33:29 +0000 (17:33 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 30 Apr 2014 10:12:37 +0000 (12:12 +0200)
* Add missing annotations
* Shorten unnecessary namespace annotations

Resolves: #57861
Releases: 6.2
Change-Id: Ic8e24e76e3ccc09122dc0a288f1e0b538685c478
Reviewed-on: https://review.typo3.org/29431
Reviewed-by: Oliver Klee
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
29 files changed:
typo3/sysext/extensionmanager/Classes/Controller/ActionController.php
typo3/sysext/extensionmanager/Classes/Controller/ConfigurationController.php
typo3/sysext/extensionmanager/Classes/Controller/DistributionController.php
typo3/sysext/extensionmanager/Classes/Controller/DownloadController.php
typo3/sysext/extensionmanager/Classes/Controller/ListController.php
typo3/sysext/extensionmanager/Classes/Controller/UpdateFromTerController.php
typo3/sysext/extensionmanager/Classes/Controller/UpdateScriptController.php
typo3/sysext/extensionmanager/Classes/Controller/UploadExtensionFileController.php
typo3/sysext/extensionmanager/Classes/Domain/Model/DownloadQueue.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/ConfigurationItemRepository.php
typo3/sysext/extensionmanager/Classes/Service/ExtensionManagementService.php
typo3/sysext/extensionmanager/Classes/Task/UpdateExtensionListTask.php
typo3/sysext/extensionmanager/Classes/Utility/Connection/TerUtility.php
typo3/sysext/extensionmanager/Classes/Utility/DependencyUtility.php
typo3/sysext/extensionmanager/Classes/Utility/EmConfUtility.php
typo3/sysext/extensionmanager/Classes/Utility/FileHandlingUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/AbstractExtensionXmlParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/AbstractMirrorXmlParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/AbstractXmlParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPullParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPullParser.php
typo3/sysext/extensionmanager/Classes/Utility/Parser/MirrorXmlPushParser.php
typo3/sysext/extensionmanager/Classes/Utility/Repository/Helper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ToggleExtensionInstallationStateViewHelper.php
typo3/sysext/extensionmanager/Resources/Public/JavaScript/main.js

index 0d0fcb2..396fa62 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class ActionController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class ActionController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility
@@ -61,40 +61,27 @@ class ActionController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractCo
        /**
         * Toggle extension installation state action
         *
-        * @param string $extension
+        * @param string $extensionKey
         */
-       protected function toggleExtensionInstallationStateAction($extension) {
+       protected function toggleExtensionInstallationStateAction($extensionKey) {
                $installedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
                try {
-                       if (in_array($extension, $installedExtensions)) {
+                       if (in_array($extensionKey, $installedExtensions)) {
                                // uninstall
-                               $this->installUtility->uninstall($extension);
+                               $this->installUtility->uninstall($extensionKey);
                        } else {
                                // install
                                $this->managementService->resolveDependenciesAndInstall(
                                        $this->extensionModelUtility->mapExtensionArrayToModel(
-                                               $this->installUtility->enrichExtensionWithDetails($extension)
+                                               $this->installUtility->enrichExtensionWithDetails($extensionKey)
                                        )
                                );
                        }
                } catch (\TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException $e) {
-                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
-                               'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
-                               htmlspecialchars($e->getMessage()),
-                               '',
-                               \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
-                               TRUE
-                       );
-                       $this->getControllerContext()->getFlashMessageQueue()->enqueue($flashMessage);
+                       $message = nl2br(htmlspecialchars($e->getMessage()));
+                       $this->addFlashMessage($message, '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                } catch (\TYPO3\Flow\Package\Exception\PackageStatesFileNotWritableException $e) {
-                       $flashMessage = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
-                               'TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
-                               htmlspecialchars($e->getMessage()),
-                               '',
-                               \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR,
-                               TRUE
-                       );
-                       $this->getControllerContext()->getFlashMessageQueue()->enqueue($flashMessage);
+                       $this->addFlashMessage(htmlspecialchars($e->getMessage()), '', \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
                }
                $this->redirect('index', 'List', NULL, array(self::TRIGGER_RefreshModuleMenu => TRUE));
        }
index 101ac4c..bca9593 100644 (file)
@@ -26,6 +26,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
 use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
 
 /**
@@ -33,7 +34,7 @@ use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class ConfigurationController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ConfigurationItemRepository
@@ -68,10 +69,10 @@ class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
                                ->assign('configuration', $configuration)
                                ->assign('extension', $extension);
                } else {
-                       /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension */
+                       /** @var Extension $extension */
                        $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extension['key']);
                        // Extension has no configuration and is a distribution
-                       if ($extension->getCategory() === \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY) {
+                       if ($extension->getCategory() === Extension::DISTRIBUTION_CATEGORY) {
                                $this->redirect('welcome', 'Distribution', NULL, array('extension' => $extension->getUid()));
                        }
                        throw new ExtensionManagerException('The extension ' . htmlspecialchars($extension['key']) . ' has no configuration.');
@@ -96,11 +97,11 @@ class ConfigurationController extends \TYPO3\CMS\Extensionmanager\Controller\Abs
                        $extensionKey
                );
                $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterExtensionConfigurationWrite', array($newConfiguration, $this));
-               /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension */
+               /** @var Extension $extension */
                $extension = $this->extensionRepository->findOneByCurrentVersionByExtensionKey($extensionKey);
                // Different handling for distribution installation
-               if ($extension instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension &&
-                       $extension->getCategory() === \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::DISTRIBUTION_CATEGORY
+               if ($extension instanceof Extension &&
+                       $extension->getCategory() === Extension::DISTRIBUTION_CATEGORY
                ) {
                        $this->redirect('welcome', 'Distribution', NULL, array('extension' => $extension->getUid()));
                } else {
index 7a31516..72e7f65 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class DistributionController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class DistributionController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Core\Package\PackageManager
index 6af67bb..9d94fa3 100644 (file)
@@ -26,12 +26,14 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+
 /**
  * Controller for actions related to the TER download of an extension
  *
  * @author Susanne Moog, <typo3@susannemoog.de>
  */
-class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class DownloadController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
@@ -100,10 +102,10 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
                        $message = $e->getMessage();
                }
                $this->view->assign('extension', $extension)
-                               ->assign('hasDependencies', $hasDependencies)
-                               ->assign('hasErrors', $hasErrors)
-                               ->assign('message', $message)
-                               ->assign('title', $title);
+                       ->assign('hasDependencies', $hasDependencies)
+                       ->assign('hasErrors', $hasErrors)
+                       ->assign('message', $message)
+                       ->assign('title', $title);
        }
 
        /**
@@ -166,7 +168,7 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
                $result = array();
 
                $extensionKey = $this->request->getArgument('extension');
-               /** @var $highestTerVersionExtension \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
+               /** @var Extension $highestTerVersionExtension */
                $highestTerVersionExtension = $this->extensionRepository->findHighestAvailableVersion($extensionKey);
                try {
                        $result = $this->managementService->resolveDependenciesAndInstall($highestTerVersionExtension);
@@ -191,7 +193,7 @@ class DownloadController extends \TYPO3\CMS\Extensionmanager\Controller\Abstract
                $extensionKey = $this->request->getArgument('extension');
                $version = $this->request->getArgument('integerVersion');
                $updateComments = array();
-               /** @var $updatableVersion \TYPO3\CMS\Extensionmanager\Domain\Model\Extension */
+               /** @var Extension[] $updatableVersions */
                $updatableVersions = $this->extensionRepository->findByVersionRangeAndExtensionKeyOrderedByVersion($extensionKey, $version);
                foreach ($updatableVersions as $updatableVersion) {
                        $updateComments[$updatableVersion->getVersion()] = $updatableVersion->getUpdateComment();
index 08c395e..4ae0d50 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class ListController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class ListController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository
index 1adae11..e1e72ff 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class UpdateFromTerController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class UpdateFromTerController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\Repository\Helper
index a6be478..8af7b02 100644 (file)
@@ -32,7 +32,7 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  * @author Francois Suter <francois.suter@typo3.org>
  */
-class UpdateScriptController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class UpdateScriptController extends AbstractController {
 
        /**
         * Show the content of the update script (if any).
index f4766b7..7dd74e9 100644 (file)
@@ -26,13 +26,15 @@ namespace TYPO3\CMS\Extensionmanager\Controller;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+
 /**
  * Controller for handling upload of a local extension file
  * Handles .t3x or .zip files
  *
  * @author Susanne Moog <typo3@susannemoog.de>
  */
-class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controller\AbstractController {
+class UploadExtensionFileController extends AbstractController {
 
        /**
         * @var \TYPO3\CMS\Extensionmanager\Utility\FileHandlingUtility
@@ -65,7 +67,7 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
         * Extract an uploaded file and install the matching extension
         *
         * @param boolean $overwrite Overwrite existing extension if TRUE
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return void
         */
        public function extractAction($overwrite = FALSE) {
@@ -74,15 +76,15 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
                        $fileExtension = pathinfo($file['name']['extensionFile'], PATHINFO_EXTENSION);
                        $fileName = pathinfo($file['name']['extensionFile'], PATHINFO_BASENAME);
                        if (empty($file['name']['extensionFile'])) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('No file given.', 1342858852);
+                               throw new ExtensionManagerException('No file given.', 1342858852);
                        }
                        if ($fileExtension !== 't3x' && $fileExtension !== 'zip') {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Wrong file format given.', 1342858853);
+                               throw new ExtensionManagerException('Wrong file format given.', 1342858853);
                        }
                        if (!empty($file['tmp_name']['extensionFile'])) {
                                $tempFile = \TYPO3\CMS\Core\Utility\GeneralUtility::upload_to_tempfile($file['tmp_name']['extensionFile']);
                        } else {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+                               throw new ExtensionManagerException(
                                        'Creating temporary file failed. Check your upload_max_filesize and post_max_size limits.',
                                        1342864339
                                );
@@ -92,10 +94,10 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
                        } else {
                                $extensionData = $this->getExtensionFromZipFile($tempFile, $fileName, $overwrite);
                        }
+                       $this->view->assign('extensionKey', $extensionData['extKey']);
                } catch (\Exception $exception) {
                        $this->view->assign('error', $exception->getMessage());
                }
-               $this->view->assign('extensionKey', $extensionData['extKey']);
        }
 
        /**
@@ -103,20 +105,20 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
         *
         * @param string $file Path to uploaded file
         * @param boolean $overwrite Overwrite existing extension if TRUE
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return array
         */
        protected function getExtensionFromT3xFile($file, $overwrite = FALSE) {
                $fileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($file);
                if (!$fileContent) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('File had no or wrong content.', 1342859339);
+                       throw new ExtensionManagerException('File had no or wrong content.', 1342859339);
                }
                $extensionData = $this->terUtility->decodeExchangeData($fileContent);
                if (empty($extensionData['extKey'])) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Decoding the file went wrong. No extension key found', 1342864309);
+                       throw new ExtensionManagerException('Decoding the file went wrong. No extension key found', 1342864309);
                }
                if (!$overwrite && $this->installUtility->isAvailable($extensionData['extKey'])) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($this->translate('extensionList.overwritingDisabled'), 1342864310);
+                       throw new ExtensionManagerException($this->translate('extensionList.overwritingDisabled'), 1342864310);
                }
                $this->fileHandlingUtility->unpackExtensionFromExtensionDataArray($extensionData);
                $this->installUtility->install($extensionData['extKey']);
@@ -133,13 +135,13 @@ class UploadExtensionFileController extends \TYPO3\CMS\Extensionmanager\Controll
         * @param string $fileName Filename (basename) of uploaded file
         * @param boolean $overwrite Overwrite existing extension if TRUE
         * @return array
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         */
        protected function getExtensionFromZipFile($file, $fileName, $overwrite = FALSE) {
                        // Remove version and ending from filename to determine extension key
                $extensionKey = preg_replace('/_(\d+)(\.|\-)(\d+)(\.|\-)(\d+).*/i', '', strtolower(substr($fileName, 0, -4)));
                if (!$overwrite && $this->installUtility->isAvailable($extensionKey)) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Extension is already available and overwriting is disabled.', 1342864311);
+                       throw new ExtensionManagerException('Extension is already available and overwriting is disabled.', 1342864311);
                }
                $this->fileHandlingUtility->unzipExtensionFromFile($file, $extensionKey);
                $this->installUtility->install($extensionKey);
index 5704882..78e947d 100644 (file)
@@ -76,7 +76,10 @@ class DownloadQueue implements \TYPO3\CMS\Core\SingletonInterface {
                }
                if (array_key_exists($extension->getExtensionKey(), $this->extensionStorage)) {
                        if (!($this->extensionStorage[$extension->getExtensionKey()] === $extension)) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException($extension->getExtensionKey() . ' was requested to be downloaded in different versions.', 1342432101);
+                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+                                       $extension->getExtensionKey() . ' was requested to be downloaded in different versions.',
+                                       1342432101
+                               );
                        }
                }
                $this->extensionStorage[$stack][$extension->getExtensionKey()] = $extension;
index bd37712..1ee0820 100644 (file)
@@ -267,11 +267,11 @@ class ConfigurationItemRepository {
         * @return string|NULL The value from LOCAL_LANG or NULL if no translation was found.
         */
        protected function translate($key, $extensionName) {
-               $translation = NULL;
-               if (\TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, $extensionName)) {
-                       $translation = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, $extensionName);
+               $translation = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($key, $extensionName);
+               if ($translation) {
+                       return $translation;
                }
-               return $translation;
+               return NULL;
        }
 
 }
\ No newline at end of file
index 4d41b0e..32d5d3f 100644 (file)
@@ -26,6 +26,8 @@ namespace TYPO3\CMS\Extensionmanager\Service;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Domain\Model\Extension;
+
 /**
  * Service class for managing multiple step processes (dependencies for example)
  *
@@ -98,10 +100,10 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Mark an extension for download
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+        * @param Extension $extension
         * @return void
         */
-       public function markExtensionForDownload(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+       public function markExtensionForDownload(Extension $extension) {
                // We have to check for dependencies of the extension first, before marking it for download
                // because this extension might have dependencies, which need to be downloaded and installed first
                $this->dependencyUtility->buildExtensionDependenciesTree($extension);
@@ -109,10 +111,10 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+        * @param Extension $extension
         * @return void
         */
-       public function markExtensionForUpdate(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+       public function markExtensionForUpdate(Extension $extension) {
                // We have to check for dependencies of the extension first, before marking it for download
                // because this extension might have dependencies, which need to be downloaded and installed first
                $this->dependencyUtility->buildExtensionDependenciesTree($extension);
@@ -123,10 +125,10 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * Resolve an extensions dependencies (download, copy and install dependent
         * extensions) and install the extension
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+        * @param Extension $extension
         * @return array
         */
-       public function resolveDependenciesAndInstall(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+       public function resolveDependenciesAndInstall(Extension $extension) {
                $this->downloadMainExtension($extension);
                $extensionKey = $extension->getExtensionKey();
                $this->setInExtensionRepository($extensionKey);
@@ -165,7 +167,7 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * @param string $extensionKey
         */
        protected function setInExtensionRepository($extensionKey) {
-               $paths = \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnInstallPaths();
+               $paths = Extension::returnInstallPaths();
                $path = $paths[$this->downloadUtility->getDownloadPath()];
                $localExtensionStorage = $path . $extensionKey . '/Initialisation/Extensions/';
                $this->dependencyUtility->setLocalExtensionStorage($localExtensionStorage);
@@ -178,7 +180,7 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * @return void
         */
        protected function copyDependencies(array $copyQueue) {
-               $installPaths = \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallPaths();
+               $installPaths = Extension::returnAllowedInstallPaths();
                foreach ($copyQueue as $extensionKey => $sourceFolder) {
                        $destination = $installPaths['Local'] . $extensionKey;
                        \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($destination);
@@ -192,7 +194,7 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * Uninstall extensions that will be updated
         * This is not strictly necessary but cleaner all in all
         *
-        * @param array<Tx_Extensionmanager_Domain_Model_Extension> $updateQueue
+        * @param Extension[] $updateQueue
         * @return array
         */
        protected function uninstallDependenciesToBeUpdated(array $updateQueue) {
@@ -230,7 +232,7 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * Download dependencies
         * expects an array of extension objects to download
         *
-        * @param array<Tx_Extensionmanager_Domain_Model_Extension> $downloadQueue
+        * @param Extension[] $downloadQueue
         * @return array
         */
        protected function downloadDependencies(array $downloadQueue) {
@@ -247,10 +249,10 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Get and resolve dependencies
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+        * @param Extension $extension
         * @return array
         */
-       public function getAndResolveDependencies(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+       public function getAndResolveDependencies(Extension $extension) {
                $this->dependencyUtility->buildExtensionDependenciesTree($extension);
                $installQueue = $this->downloadQueue->getExtensionInstallStorage();
                if (is_array($installQueue) && count($installQueue) > 0) {
@@ -264,10 +266,10 @@ class ExtensionManagementService implements \TYPO3\CMS\Core\SingletonInterface {
         * This is separated from downloading the dependencies
         * as an extension is able to provide it's own dependencies
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
+        * @param Extension $extension
         * @return void
         */
-       public function downloadMainExtension(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
+       public function downloadMainExtension(Extension $extension) {
                // The extension object has a uid if the extension is not present in the system
                // or an update of a present extension is triggered.
                if ($extension->getUid()) {
index f91523a..05f16dd 100644 (file)
@@ -38,7 +38,7 @@ class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
         */
        public function execute() {
                // Throws exceptions if something went wrong
-               $this->updateExtensionlist();
+               $this->updateExtensionList();
 
                return TRUE;
        }
@@ -49,7 +49,7 @@ class UpdateExtensionListTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask {
         * @TODO: Adapt to multiple repositories if the Helper can handle this
         * @return void
         */
-       protected function updateExtensionlist() {
+       protected function updateExtensionList() {
                /** @var $objectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
                $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
 
index 02c0a81..61b39a1 100644 (file)
@@ -27,6 +27,8 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Connection;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+
 /**
  * TER2 connection handling class for the TYPO3 Extension Manager.
  *
@@ -49,7 +51,7 @@ class TerUtility {
         * @param string $version Version to install
         * @param string $expectedMd5 Expected MD5 hash of extension file
         * @param string $mirrorUrl URL of mirror to use
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return array T3X data
         */
        public function fetchExtension($extensionKey, $version, $expectedMd5, $mirrorUrl) {
@@ -58,13 +60,13 @@ class TerUtility {
                $t3x = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($mirrorUrl, 0, array(TYPO3_user_agent));
                $md5 = md5($t3x);
                if ($t3x === FALSE) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('The T3X file "%s" could not be fetched. Possible reasons: network problems, allow_url_fopen is off,' . ' cURL is not enabled in Install Tool.', $mirrorUrl), 1334426097);
+                       throw new ExtensionManagerException(sprintf('The T3X file "%s" could not be fetched. Possible reasons: network problems, allow_url_fopen is off,' . ' cURL is not enabled in Install Tool.', $mirrorUrl), 1334426097);
                }
                if ($md5 === $expectedMd5) {
                        // Fetch and return:
                        $extensionData = $this->decodeExchangeData($t3x);
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Error: MD5 hash of downloaded file not as expected:<br />' . $md5 . ' != ' . $expectedMd5, 1334426098);
+                       throw new ExtensionManagerException('Error: MD5 hash of downloaded file not as expected:<br />' . $md5 . ' != ' . $expectedMd5, 1334426098);
                }
                return $extensionData;
        }
@@ -77,7 +79,7 @@ class TerUtility {
         * array as key 0 and 1.
         *
         * @param string $externalData Data stream from remove server
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return array $externalData
         * @see fetchServerData(), processRepositoryReturnData()
         */
@@ -91,15 +93,15 @@ class TerUtility {
                                if (function_exists('gzuncompress')) {
                                        $dat = gzuncompress($dat);
                                } else {
-                                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Decoding Error: No decompressor available for compressed content. gzuncompress() function is not available!', 1342859463);
+                                       throw new ExtensionManagerException('Decoding Error: No decompressor available for compressed content. gzuncompress() function is not available!', 1342859463);
                                }
                        }
                        $listArr = unserialize($dat);
                        if (!is_array($listArr)) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Error: Unserialized information was not an array - strange!', 1342859489);
+                               throw new ExtensionManagerException('Error: Unserialized information was not an array - strange!', 1342859489);
                        }
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Error: MD5 hashes in T3X data did not match!', 1342859505);
+                       throw new ExtensionManagerException('Error: MD5 hashes in T3X data did not match!', 1342859505);
                }
                return $listArr;
        }
@@ -109,7 +111,7 @@ class TerUtility {
         * This kind of data is when an extension is uploaded to TER
         *
         * @param string $stream Data stream
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return array Array with result on success, otherwise an error string.
         */
        public function decodeExchangeData($stream) {
@@ -118,16 +120,16 @@ class TerUtility {
                        if (function_exists('gzuncompress')) {
                                $parts[2] = gzuncompress($parts[2]);
                        } else {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Decoding Error: No decompressor available for compressed content. gzcompress()/gzuncompress() ' . 'functions are not available!', 1344761814);
+                               throw new ExtensionManagerException('Decoding Error: No decompressor available for compressed content. gzcompress()/gzuncompress() ' . 'functions are not available!', 1344761814);
                        }
                }
                if (md5($parts[2]) === $parts[0]) {
                        $output = unserialize($parts[2]);
                        if (!is_array($output)) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Error: Content could not be unserialized to an array. Strange (since MD5 hashes match!)', 1344761938);
+                               throw new ExtensionManagerException('Error: Content could not be unserialized to an array. Strange (since MD5 hashes match!)', 1344761938);
                        }
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Error: MD5 mismatch. Maybe the extension file was downloaded and saved as a text file by the ' . 'browser and thereby corrupted!? (Always select "All" filetype when saving extensions)', 1344761991);
+                       throw new ExtensionManagerException('Error: MD5 mismatch. Maybe the extension file was downloaded and saved as a text file by the ' . 'browser and thereby corrupted!? (Always select "All" filetype when saving extensions)', 1344761991);
                }
                return $output;
        }
index 90e8991..5a0da13 100644 (file)
@@ -26,6 +26,9 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Extensionmanager\Domain\Model\Dependency;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+
 /**
  * Utility for dealing with dependencies
  *
@@ -68,7 +71,6 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
         */
        protected $availableExtensions = array();
 
-
        /**
         * @var string
         */
@@ -93,7 +95,7 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
 
        /**
         * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         */
        public function buildExtensionDependenciesTree(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extension) {
                $dependencies = $extension->getDependencies();
@@ -104,13 +106,15 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Checks dependencies for special cases (currently typo3 and php)
         *
         * @param \SplObjectStorage $dependencies
+        * @throws ExtensionManagerException
         * @return boolean
         */
        protected function checkDependencies(\SplObjectStorage $dependencies) {
                $dependenciesToResolve = FALSE;
                foreach ($dependencies as $dependency) {
+                       /** @var Dependency $dependency */
                        $identifier = strtolower($dependency->getIdentifier());
-                       if (in_array($identifier, \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency::$specialDependencies)) {
+                       if (in_array($identifier, Dependency::$specialDependencies)) {
                                $methodname = 'check' . ucfirst($identifier) . 'Dependency';
                                $this->{$methodname}($dependency);
                        } else {
@@ -125,21 +129,21 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Returns true if current TYPO3 version fulfills extension requirements
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         */
-       protected function checkTypo3Dependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function checkTypo3Dependency(Dependency $dependency) {
                $lowerCaseIdentifier = strtolower($dependency->getIdentifier());
                if ($lowerCaseIdentifier === 'typo3') {
                        if (!($dependency->getLowestVersion() === '') && version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(), $dependency->getLowestVersion()) === -1) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Your TYPO3 version is lower than necessary. You need at least TYPO3 version ' . $dependency->getLowestVersion());
+                               throw new ExtensionManagerException('Your TYPO3 version is lower than necessary. You need at least TYPO3 version ' . $dependency->getLowestVersion());
                        }
                        if (!($dependency->getHighestVersion() === '') && version_compare($dependency->getHighestVersion(), \TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version()) === -1) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Your TYPO3 version is higher than allowed. You can use TYPO3 versions ' . $dependency->getLowestVersion() . ' - ' . $dependency->getHighestVersion());
+                               throw new ExtensionManagerException('Your TYPO3 version is higher than allowed. You can use TYPO3 versions ' . $dependency->getLowestVersion() . ' - ' . $dependency->getHighestVersion());
                        }
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('checkTypo3Dependency can only check TYPO3 dependencies. Found dependency with identifier "' . $dependency->getIdentifier() . '"');
+                       throw new ExtensionManagerException('checkTypo3Dependency can only check TYPO3 dependencies. Found dependency with identifier "' . $dependency->getIdentifier() . '"');
                }
                return TRUE;
        }
@@ -147,27 +151,27 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Returns true if current php version fulfills extension requirements
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         */
-       protected function checkPhpDependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function checkPhpDependency(Dependency $dependency) {
                $lowerCaseIdentifier = strtolower($dependency->getIdentifier());
                if ($lowerCaseIdentifier === 'php') {
                        if (!($dependency->getLowestVersion() === '') && version_compare(PHP_VERSION, $dependency->getLowestVersion()) === -1) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+                               throw new ExtensionManagerException(
                                        'Your PHP version is lower than necessary. You need at least PHP version ' . $dependency->getLowestVersion(),
                                         1377977857
                                );
                        }
                        if (!($dependency->getHighestVersion() === '') && version_compare($dependency->getHighestVersion(), PHP_VERSION) === -1) {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+                               throw new ExtensionManagerException(
                                        'Your PHP version is higher than allowed. You can use PHP versions ' . $dependency->getLowestVersion() . ' - ' . $dependency->getHighestVersion(),
                                        1377977856
                                );
                        }
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
+                       throw new ExtensionManagerException(
                                'checkPhpDependency can only check PHP dependencies. Found dependency with identifier "' . $dependency->getIdentifier() . '"',
                                1377977858
                        );
@@ -183,10 +187,11 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * - remote (TER) extension in matching version? - mark for download
         *
         * @todo handle exceptions / markForUpload
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
+        * @throws ExtensionManagerException
         * @return boolean
         */
-       protected function checkExtensionDependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function checkExtensionDependency(Dependency $dependency) {
                $extensionKey = $dependency->getIdentifier();
                $extensionIsLoaded = $this->isDependentExtensionLoaded($extensionKey);
                if ($extensionIsLoaded === TRUE) {
@@ -194,7 +199,11 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        if ($isLoadedVersionCompatible === TRUE) {
                                return TRUE;
                        } else {
-                               $this->getExtensionFromRepository($extensionKey, $dependency);
+                               try {
+                                       $this->getExtensionFromRepository($extensionKey, $dependency);
+                               } catch (ExtensionManagerException $e) {
+                                       throw new ExtensionManagerException('The extension ' . $dependency->getIdentifier() . ' is needed in version ' . $dependency->getLowestVersion() . ' - ' . $dependency->getHighestVersion() . ', but could not be fetched from TER', 1396302624);
+                               }
                        }
                } else {
                        $extensionIsAvailable = $this->isDependentExtensionAvailable($extensionKey);
@@ -217,10 +226,10 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * (might be in the extension itself or the TER)
         *
         * @param string $extensionKey
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return void
         */
-       protected function getExtensionFromRepository($extensionKey, \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function getExtensionFromRepository($extensionKey, Dependency $dependency) {
                if (!$this->getExtensionFromInExtensionRepository($extensionKey, $dependency)) {
                        $this->getExtensionFromTer($extensionKey, $dependency);
                }
@@ -245,35 +254,32 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * Handles checks to find a compatible extension version from TER
-        * to fulfill given dependency
+        * Handles checks to find a compatible extension version from TER to fulfill given dependency
         *
         * @todo unit tests
         * @param string $extensionKey
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @param Dependency $dependency
+        * @throws ExtensionManagerException
         * @return void
         */
-       protected function getExtensionFromTer($extensionKey, \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
-               $isExtensionDownloadableFromTer = $this->isExtensionDownloadableFromTer($extensionKey);
-               if ($isExtensionDownloadableFromTer === TRUE) {
-                       $isDownloadableVersionCompatible = $this->isDownloadableVersionCompatible($dependency);
-                       if ($isDownloadableVersionCompatible === TRUE) {
-                               $latestCompatibleExtensionByIntegerVersionDependency = $this->getLatestCompatibleExtensionByIntegerVersionDependency($dependency);
-                               if ($latestCompatibleExtensionByIntegerVersionDependency instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) {
-                                       if ($this->isDependentExtensionLoaded($extensionKey)) {
-                                               $this->managementService->markExtensionForUpdate($latestCompatibleExtensionByIntegerVersionDependency);
-                                       } else {
-                                               $this->managementService->markExtensionForDownload($latestCompatibleExtensionByIntegerVersionDependency);
-                                       }
-                               } else {
-                                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Could not resolve dependency for "' . $dependency->getIdentifier() . '"');
-                               }
-                       } else {
-                               throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('No compatible version found for extension ' . $extensionKey);
-                       }
+       protected function getExtensionFromTer($extensionKey, Dependency $dependency) {
+               if (!$this->isExtensionDownloadableFromTer($extensionKey)) {
+                       throw new ExtensionManagerException('The extension ' . $extensionKey . ' is not available from TER.');
+               }
+
+               if (!$this->isDownloadableVersionCompatible($dependency)) {
+                       throw new ExtensionManagerException('No compatible version found for extension ' . $extensionKey);
+               }
+
+               $latestCompatibleExtensionByIntegerVersionDependency = $this->getLatestCompatibleExtensionByIntegerVersionDependency($dependency);
+               if (!$latestCompatibleExtensionByIntegerVersionDependency instanceof \TYPO3\CMS\Extensionmanager\Domain\Model\Extension) {
+                       throw new ExtensionManagerException('Could not resolve dependency for "' . $dependency->getIdentifier() . '"');
+               }
+
+               if ($this->isDependentExtensionLoaded($extensionKey)) {
+                       $this->managementService->markExtensionForUpdate($latestCompatibleExtensionByIntegerVersionDependency);
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('The extension ' . $extensionKey . ' is not available from TER.');
+                       $this->managementService->markExtensionForDownload($latestCompatibleExtensionByIntegerVersionDependency);
                }
        }
 
@@ -286,20 +292,20 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        }
 
        /**
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
         */
-       protected function isLoadedVersionCompatible(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function isLoadedVersionCompatible(Dependency $dependency) {
                $extensionVersion = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getExtensionVersion($dependency->getIdentifier());
                return $this->isVersionCompatible($extensionVersion, $dependency);
        }
 
        /**
         * @param string $version
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
         */
-       protected function isVersionCompatible($version, \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function isVersionCompatible($version, Dependency $dependency) {
                if (!($dependency->getLowestVersion() === '') && version_compare($version, $dependency->getLowestVersion()) === -1) {
                        return FALSE;
                }
@@ -324,10 +330,10 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Checks whether the available version is compatible
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
         */
-       protected function isAvailableVersionCompatible(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function isAvailableVersionCompatible(Dependency $dependency) {
                $this->setAvailableExtensions();
                $extensionData = $this->emConfUtility->includeEmConf($this->availableExtensions[$dependency->getIdentifier()]);
                return $this->isVersionCompatible($extensionData['version'], $dependency);
@@ -346,10 +352,10 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Checks whether a compatible version of the extension exists in TER
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return boolean
         */
-       protected function isDownloadableVersionCompatible(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function isDownloadableVersionCompatible(Dependency $dependency) {
                $versions = $this->getLowestAndHighestIntegerVersions($dependency);
                return count($this->extensionRepository->countByVersionRangeAndExtensionKey($dependency->getIdentifier(), $versions['lowestIntegerVersion'], $versions['highestIntegerVersion'])) > 0;
        }
@@ -358,10 +364,10 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Get the latest compatible version of an extension that
         * fulfills the given dependency from TER
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return \TYPO3\CMS\Extensionmanager\Domain\Model\Extension
         */
-       protected function getLatestCompatibleExtensionByIntegerVersionDependency(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function getLatestCompatibleExtensionByIntegerVersionDependency(Dependency $dependency) {
                $versions = $this->getLowestAndHighestIntegerVersions($dependency);
                $compatibleDataSets = $this->extensionRepository->findByVersionRangeAndExtensionKeyOrderedByVersion(
                        $dependency->getIdentifier(),
@@ -374,10 +380,10 @@ class DependencyUtility implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Return array of lowest and highest version of dependency as integer
         *
-        * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency
+        * @param Dependency $dependency
         * @return array
         */
-       protected function getLowestAndHighestIntegerVersions(\TYPO3\CMS\Extensionmanager\Domain\Model\Dependency $dependency) {
+       protected function getLowestAndHighestIntegerVersions(Dependency $dependency) {
                $lowestVersion = $dependency->getLowestVersion();
                $lowestVersionInteger = $lowestVersion ? \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionNumberToInteger($lowestVersion) : 0;
                $highestVersion = $dependency->getHighestVersion();
index 8338896..b66faa5 100644 (file)
@@ -92,7 +92,10 @@ $EM_CONF[$_EXTKEY] = ' . $emConf . ';
         * @return array
         */
        public function fixEmConf(array $emConf) {
-               if (!isset($emConf['constraints']) || !isset($emConf['constraints']['depends']) || !isset($emConf['constraints']['conflicts']) || !isset($emConf['constraints']['suggests'])) {
+               if (
+                       !isset($emConf['constraints']) || !isset($emConf['constraints']['depends'])
+                       || !isset($emConf['constraints']['conflicts']) || !isset($emConf['constraints']['suggests'])
+               ) {
                        if (!isset($emConf['constraints']) || !isset($emConf['constraints']['depends'])) {
                                $emConf['constraints']['depends'] = $this->stringToDependency($emConf['dependencies']);
                                if (strlen($emConf['PHP_version'])) {
index 311042b..31de059 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 namespace TYPO3\CMS\Extensionmanager\Utility;
 use \TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException;
+use TYPO3\CMS\Lang\LanguageService;
 
 /***************************************************************
  *  Copyright notice
@@ -109,13 +111,16 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Wrapper for utility method to create directory recusively
         *
         * @param string $directory Absolute path
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         */
        protected function createNestedDirectory($directory) {
                try {
                        GeneralUtility::mkdir_deep($directory);
                } catch(\RuntimeException $exception) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf($GLOBALS['LANG']->getLL('clearMakeExtDir_could_not_create_dir'), $this->getRelativePath($directory)), 1337280416);
+                       throw new ExtensionManagerException(
+                               sprintf($this->getLanguageService()->getLL('clearMakeExtDir_could_not_create_dir'), $this->getRelativePath($directory)),
+                               1337280416
+                       );
                }
 
        }
@@ -139,14 +144,17 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @param string $extensionkey
         * @param string $pathType Extension installation scope (Local,Global,System)
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return string
         */
        protected function makeAndClearExtensionDir($extensionkey, $pathType = 'Local') {
                $paths = \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnInstallPaths();
                $path = $paths[$pathType];
                if (!$path || !is_dir($path) || !$extensionkey) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf('ERROR: The extension install path "%s" was no directory!', $this->getRelativePath($path)), 1337280417);
+                       throw new ExtensionManagerException(
+                               sprintf('ERROR: The extension install path "%s" was no directory!', $this->getRelativePath($path)),
+                               1337280417
+                       );
                } else {
                        $extDirPath = $path . $extensionkey . '/';
                        if (is_dir($extDirPath)) {
@@ -161,13 +169,16 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Add specified directory
         *
         * @param string $extDirPath
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return void
         */
        protected function addDirectory($extDirPath) {
                GeneralUtility::mkdir($extDirPath);
                if (!is_dir($extDirPath)) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf($GLOBALS['LANG']->getLL('clearMakeExtDir_could_not_create_dir'), $this->getRelativePath($extDirPath)), 1337280418);
+                       throw new ExtensionManagerException(
+                               sprintf($this->getLanguageService()->getLL('clearMakeExtDir_could_not_create_dir'), $this->getRelativePath($extDirPath)),
+                               1337280418
+                       );
                }
        }
 
@@ -231,7 +242,7 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Remove specified directory
         *
         * @param string $extDirPath
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return void
         */
        public function removeDirectory($extDirPath) {
@@ -242,7 +253,10 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        $result = GeneralUtility::rmdir($extDirPath, TRUE);
                }
                if ($result === FALSE) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(sprintf($GLOBALS['LANG']->getLL('clearMakeExtDir_could_not_remove_dir'), $this->getRelativePath($extDirPath)), 1337280415);
+                       throw new ExtensionManagerException(
+                               sprintf($this->getLanguageService()->getLL('clearMakeExtDir_could_not_remove_dir'), $this->getRelativePath($extDirPath)),
+                               1337280415
+                       );
                }
        }
 
@@ -279,12 +293,13 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Returns absolute path
         *
         * @param string $relativePath
+        * @throws ExtensionManagerException
         * @return string
         */
        protected function getAbsolutePath($relativePath) {
                $absolutePath = GeneralUtility::getFileAbsFileName(GeneralUtility::resolveBackPath(PATH_site . $relativePath));
                if (empty($absolutePath)) {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Illegal relative path given', 1350742864);
+                       throw new ExtensionManagerException('Illegal relative path given', 1350742864);
                }
                return $absolutePath;
        }
@@ -385,7 +400,7 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * @param string $file path to zip file
         * @param string $fileName file name
         * @param string $pathType path type (Local, Global, System)
-        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
+        * @throws ExtensionManagerException
         * @return void
         */
        public function unzipExtensionFromFile($file, $fileName, $pathType = 'Local') {
@@ -403,7 +418,7 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                                        if (strlen(trim($file)) > 0) {
                                                $return = GeneralUtility::writeFile($extensionDir . $dir . '/' . $file, zip_entry_read($zipEntry, zip_entry_filesize($zipEntry)));
                                                if ($return === FALSE) {
-                                                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Could not write file ' . $this->getRelativePath($file), 1344691048);
+                                                       throw new ExtensionManagerException('Could not write file ' . $this->getRelativePath($file), 1344691048);
                                                }
                                        }
                                } else {
@@ -411,7 +426,7 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                                }
                        }
                } else {
-                       throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException('Unable to open zip file ' . $this->getRelativePath($file), 1344691049);
+                       throw new ExtensionManagerException('Unable to open zip file ' . $this->getRelativePath($file), 1344691049);
                }
        }
 
@@ -455,4 +470,11 @@ class FileHandlingUtility implements \TYPO3\CMS\Core\SingletonInterface {
                die;
        }
 
+       /**
+        * @return LanguageService
+        */
+       protected function getLanguageService() {
+               return $GLOBALS['LANG'];
+       }
+
 }
index ffc57c1..deeebc8 100644 (file)
@@ -167,7 +167,7 @@ class ExtensionListUtility implements \SplObserver {
        /**
         * Method collects and stores extension version details into the database.
         *
-        * @param SplSubject &$subject a subject notifying this observer
+        * @param \SplSubject|\TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser &$subject a subject notifying this observer
         * @return void
         */
        protected function loadIntoDatabase(\SplSubject &$subject) {
@@ -177,7 +177,7 @@ class ExtensionListUtility implements \SplObserver {
                        $this->arrRows = array();
                }
                $versionRepresentations = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionStringToArray($subject->getVersion());
-               // order must match that of self::$fieldNamses!
+               // order must match that of self::$fieldNames!
                $this->arrRows[] = array(
                        $subject->getExtkey(),
                        $subject->getVersion(),
@@ -207,7 +207,7 @@ class ExtensionListUtility implements \SplObserver {
        /**
         * Method receives an update from a subject.
         *
-        * @param SplSubject $subject a subject notifying this observer
+        * @param \SplSubject $subject a subject notifying this observer
         * @return void
         */
        public function update(\SplSubject $subject) {
index cbacd9a..1debc44 100644 (file)
@@ -56,9 +56,8 @@ class MirrorListUtility implements \SplObserver {
        /**
         * Class constructor.
         *
-        * Method retrieves and initializes extension XML parser instance.
-        *
-        * @throws tx_em_XmlException
+        * Method retrieves and initializes extension XML parser instance
+        * @throws \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException
         */
        public function __construct() {
                // TODO catch parser exception
@@ -90,7 +89,7 @@ class MirrorListUtility implements \SplObserver {
        /**
         * Method receives an update from a subject.
         *
-        * @param SplSubject $subject a subject notifying this observer
+        * @param \SplSubject $subject a subject notifying this observer
         * @return void
         */
        public function update(\SplSubject $subject) {
index 513ff9e..6c5316f 100644 (file)
@@ -317,14 +317,15 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        $fieldDefinitionsFromCurrentDatabase = $this->installToolSqlParser->getFieldDefinitions_database();
                        $diff = $this->installToolSqlParser->getDatabaseExtra($fieldDefinitionsFromFile, $fieldDefinitionsFromCurrentDatabase);
                        $updateStatements = $this->installToolSqlParser->getUpdateSuggestions($diff);
+                       $db = $this->getDatabaseConnection();
                        foreach ((array) $updateStatements['add'] as $string) {
-                               $GLOBALS['TYPO3_DB']->admin_query($string);
+                               $db->admin_query($string);
                        }
                        foreach ((array) $updateStatements['change'] as $string) {
-                               $GLOBALS['TYPO3_DB']->admin_query($string);
+                               $db->admin_query($string);
                        }
                        foreach ((array) $updateStatements['create_table'] as $string) {
-                               $GLOBALS['TYPO3_DB']->admin_query($string);
+                               $db->admin_query($string);
                        }
                }
        }
@@ -338,14 +339,15 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
        public function importStaticSql($rawDefinitions) {
                $statements = $this->installToolSqlParser->getStatementarray($rawDefinitions, 1);
                list($statementsPerTable, $insertCount) = $this->installToolSqlParser->getCreateTables($statements, 1);
+               $db = $this->getDatabaseConnection();
                // Traverse the tables
                foreach ($statementsPerTable as $table => $query) {
-                       $GLOBALS['TYPO3_DB']->admin_query('DROP TABLE IF EXISTS ' . $table);
-                       $GLOBALS['TYPO3_DB']->admin_query($query);
+                       $db->admin_query('DROP TABLE IF EXISTS ' . $table);
+                       $db->admin_query($query);
                        if ($insertCount[$table]) {
                                $insertStatements = $this->installToolSqlParser->getTableInsertStatements($statements, $table);
                                foreach ($insertStatements as $statement) {
-                                       $GLOBALS['TYPO3_DB']->admin_query($statement);
+                                       $db->admin_query($statement);
                                }
                        }
                }
@@ -494,4 +496,12 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        }
                }
        }
+
+
+       /**
+        * @return \TYPO3\CMS\Core\Database\DatabaseConnection
+        */
+       protected function getDatabaseConnection() {
+               return $GLOBALS['TYPO3_DB'];
+       }
 }
index 2fb9ad9..9471342 100644 (file)
@@ -37,7 +37,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @since 2010-02-09
  */
-abstract class AbstractExtensionXmlParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractXmlParser {
+abstract class AbstractExtensionXmlParser extends AbstractXmlParser {
 
        /**
         * Keeps current author company of an extension's version.
index 3227b3f..8653a6f 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @since 2010-02-09
  */
-abstract class AbstractMirrorXmlParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractXmlParser {
+abstract class AbstractMirrorXmlParser extends AbstractXmlParser {
 
        /**
         * Keeps country of currently processed mirror.
@@ -189,7 +189,8 @@ abstract class AbstractMirrorXmlParser extends \TYPO3\CMS\Extensionmanager\Utili
         * @see $country, $host, $path, $sponsorlink, $sponsorlogo, $sponsorname, $title
         */
        protected function resetProperties() {
-               $this->title = ($this->host = ($this->path = ($this->country = ($this->sponsorname = ($this->sponsorlink = $this->sponsorlogo)))));
+               $this->title = $this->host = $this->path = $this->country
+                       = $this->sponsorname = $this->sponsorlink = $this->sponsorlogo = NULL;
        }
 
 }
index 6ad0808..ae4fb55 100644 (file)
@@ -31,7 +31,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @since 2010-02-09
  */
-abstract class AbstractXmlParser {
+abstract class AbstractXmlParser implements \SplSubject {
 
        /**
         * Keeps XML parser instance.
@@ -49,6 +49,51 @@ abstract class AbstractXmlParser {
        protected $requiredPhpExtensions;
 
        /**
+        * Keeps list of attached observers.
+        *
+        * @var \SplObserver[]
+        */
+       protected $observers = array();
+
+       /**
+        * Method attaches an observer.
+        *
+        * @param \SplObserver $observer an observer to attach
+        * @return void
+        * @see $observers, detach(), notify()
+        */
+       public function attach(\SplObserver $observer) {
+               $this->observers[] = $observer;
+       }
+
+       /**
+        * Method detaches an attached observer
+        *
+        * @param \SplObserver $observer an observer to detach
+        * @return void
+        * @see $observers, attach(), notify()
+        */
+       public function detach(\SplObserver $observer) {
+               $key = array_search($observer, $this->observers, TRUE);
+               if ($key !== FALSE) {
+                       unset($this->observers[$key]);
+               }
+       }
+
+       /**
+        * Method notifies attached observers.
+        *
+        * @access public
+        * @return void
+        * @see $observers, attach(), detach()
+        */
+       public function notify() {
+               foreach ($this->observers as $observer) {
+                       $observer->update($this);
+               }
+       }
+
+       /**
         * Method determines if a necessary PHP extension is available.
         *
         * Method tries to load the extension if necessary and possible.
index 80d3ea0..771f1b7 100644 (file)
@@ -37,14 +37,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author       Steffen Kamper <info@sk-typo3.de>
  * @since         2010-02-09
  */
-class ExtensionXmlPullParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser implements \SplSubject {
-
-       /**
-        * Keeps list of attached observers.
-        *
-        * @var SplObserver[]
-        */
-       protected $observers = array();
+class ExtensionXmlPullParser extends AbstractExtensionXmlParser {
 
        /**
         * Class constructor.
@@ -200,39 +193,4 @@ class ExtensionXmlPullParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\
                }
                return $value;
        }
-
-       /**
-        * Method attaches an observer.
-        *
-        * @param SplObserver  $observer: an observer to attach
-        * @return void
-        */
-       public function attach(\SplObserver $observer) {
-               $this->observers[] = $observer;
-       }
-
-       /**
-        * Method detaches an attached observer
-        *
-        * @param SplObserver  $observer: an observer to detach
-        * @return void
-        */
-       public function detach(\SplObserver $observer) {
-               $key = array_search($observer, $this->observers, TRUE);
-               if (!($key === FALSE)) {
-                       unset($this->observers[$key]);
-               }
-       }
-
-       /**
-        * Method notifies attached observers.
-        *
-        * @return void
-        */
-       public function notify() {
-               foreach ($this->observers as $observer) {
-                       $observer->update($this);
-               }
-       }
-
 }
index 85d9114..c15db9c 100644 (file)
@@ -41,7 +41,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @since 2010-02-10
  */
-class ExtensionXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser implements \SplSubject {
+class ExtensionXmlPushParser extends AbstractExtensionXmlParser {
 
        /**
         * Keeps current element to process.
@@ -51,13 +51,6 @@ class ExtensionXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\
        protected $element = NULL;
 
        /**
-        * Keeps list of attached observers.
-        *
-        * @var SplObserver[]
-        */
-       protected $observers = array();
-
-       /**
         * Class constructor.
         */
        public function __construct() {
@@ -148,8 +141,8 @@ class ExtensionXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\
        /**
         * Method is invoked when parser accesses any character other than elements.
         *
-        * @param resource  $parser: parser resource
-        * @param string         $data: an element's value
+        * @param resource $parser parser resource
+        * @param string $data: an element's value
         * @return void
         */
        protected function characterData($parser, $data) {
@@ -206,39 +199,4 @@ class ExtensionXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\
                        }
                }
        }
-
-       /**
-        * Method attaches an observer.
-        *
-        * @param SplObserver  $observer: an observer to attach
-        * @return void
-        */
-       public function attach(\SplObserver $observer) {
-               $this->observers[] = $observer;
-       }
-
-       /**
-        * Method detaches an attached observer
-        *
-        * @param SplObserver  $observer: an observer to detach
-        * @return void
-        */
-       public function detach(\SplObserver $observer) {
-               $key = array_search($observer, $this->observers, TRUE);
-               if (!($key === FALSE)) {
-                       unset($this->observers[$key]);
-               }
-       }
-
-       /**
-        * Method notifies attached observers.
-        *
-        * @return void
-        */
-       public function notify() {
-               foreach ($this->observers as $observer) {
-                       $observer->update($this);
-               }
-       }
-
 }
index 02b1b5d..ce4c4b1 100644 (file)
@@ -34,14 +34,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @sincer 2010-02-19
  */
-class MirrorXmlPullParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractMirrorXmlParser implements \SplSubject {
-
-       /**
-        * Keeps list of attached observers.
-        *
-        * @var SplObserver[]
-        */
-       protected $observers = array();
+class MirrorXmlPullParser extends AbstractMirrorXmlParser {
 
        /**
         * Class constructor.
@@ -169,43 +162,4 @@ class MirrorXmlPullParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\Abs
                }
                return $value;
        }
-
-       /**
-        * Method attaches an observer.
-        *
-        * @param SplObserver $observer an observer to attach
-        * @return void
-        * @see $observers, detach(), notify()
-        */
-       public function attach(\SplObserver $observer) {
-               $this->observers[] = $observer;
-       }
-
-       /**
-        * Method detaches an attached observer
-        *
-        * @param SplObserver $observer an observer to detach
-        * @return void
-        * @see $observers, attach(), notify()
-        */
-       public function detach(\SplObserver $observer) {
-               $key = array_search($observer, $this->observers, TRUE);
-               if (!($key === FALSE)) {
-                       unset($this->observers[$key]);
-               }
-       }
-
-       /**
-        * Method notifies attached observers.
-        *
-        * @access public
-        * @return void
-        * @see $observers, attach(), detach()
-        */
-       public function notify() {
-               foreach ($this->observers as $observer) {
-                       $observer->update($this);
-               }
-       }
-
 }
index 7eb899b..35c3a7d 100644 (file)
@@ -38,14 +38,12 @@ namespace TYPO3\CMS\Extensionmanager\Utility\Parser;
  * @author Steffen Kamper <info@sk-typo3.de>
  * @since 2010-11-17
  */
-class MirrorXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractMirrorXmlParser implements \SplSubject {
+class MirrorXmlPushParser extends AbstractMirrorXmlParser {
 
        /**
-        * Keeps list of attached observers.
-        *
-        * @var SplObserver[]
+        * @var string
         */
-       protected $observers = array();
+       protected $element;
 
        /**
         * Class constructor.
@@ -168,43 +166,4 @@ class MirrorXmlPushParser extends \TYPO3\CMS\Extensionmanager\Utility\Parser\Abs
                        }
                }
        }
-
-       /**
-        * Method attaches an observer.
-        *
-        * @param SplObserver $observer an observer to attach
-        * @return void
-        * @see $observers, detach(), notify()
-        */
-       public function attach(\SplObserver $observer) {
-               $this->observers[] = $observer;
-       }
-
-       /**
-        * Method detaches an attached observer
-        *
-        * @param SplObserver $observer an observer to detach
-        * @return void
-        * @see $observers, attach(), notify()
-        */
-       public function detach(\SplObserver $observer) {
-               $key = array_search($observer, $this->observers, TRUE);
-               if (!($key === FALSE)) {
-                       unset($this->observers[$key]);
-               }
-       }
-
-       /**
-        * Method notifies attached observers.
-        *
-        * @access public
-        * @return void
-        * @see $observers, attach(), detach()
-        */
-       public function notify() {
-               foreach ($this->observers as $observer) {
-                       $observer->update($this);
-               }
-       }
-
 }
index cd450c0..e6504a3 100644 (file)
@@ -80,8 +80,10 @@ class Helper implements \TYPO3\CMS\Core\SingletonInterface {
        public function __construct() {
                /** @var $objectManager \TYPO3\CMS\Extbase\Object\ObjectManager */
                $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               /** @var \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository */
                $repositoryRepository = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\RepositoryRepository');
                $this->extensionRepository = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Domain\\Repository\\ExtensionRepository');
+               /** @var \TYPO3\CMS\Extensionmanager\Domain\Model\Repository $repository */
                $repository = $repositoryRepository->findByUid(1);
                if (is_object($repository)) {
                        $this->setRepository($repository);
index 749c51a..3264810 100644 (file)
@@ -56,7 +56,7 @@ class ToggleExtensionInstallationStateViewHelper extends \TYPO3\CMS\Fluid\ViewHe
                $uriBuilder = $this->controllerContext->getUriBuilder();
                $action = 'toggleExtensionInstallationState';
                $uri = $uriBuilder->reset()->uriFor($action, array(
-                       'extension' => $extension['key']
+                       'extensionKey' => $extension['key']
                ), 'Action');
                $this->tag->addAttribute('href', $uri);
                $label = $extension['installed'] ? 'deactivate' : 'activate';
index d258638..f775044 100644 (file)
                                });
                        });
                });
-
        }
 
        function updateExtension(data) {