[TASK] Use fully qualified name resolution in PHP 5.5
[Packages/TYPO3.CMS.git] / typo3 / sysext / extensionmanager / Classes / Utility / InstallUtility.php
index 42653d1..0436404 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Extensionmanager\Utility;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Impexp\Utility\ImportExportUtility;
 
 /**
  * Extension Manager Install Utility
@@ -106,7 +107,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                $this->reloadCaches();
                $this->processRuntimeDatabaseUpdates($extensionKey);
                $this->saveDefaultConfiguration($extension['key']);
-               if ($extension['clearcacheonload']) {
+               if (!empty($extension['clearcacheonload']) || !empty($extension['clearCacheOnLoad'])) {
                        $this->cacheManager->flushCaches();
                } else {
                        $this->cacheManager->flushCachesInGroup('system');
@@ -140,7 +141,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Wrapper function to check for loaded extensions
         *
         * @param string $extensionKey
-        * @return boolean TRUE if extension is loaded
+        * @return bool TRUE if extension is loaded
         */
        public function isLoaded($extensionKey) {
                return $this->packageManager->isPackageActive($extensionKey);
@@ -171,7 +172,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Checks if an extension is available in the system
         *
         * @param $extensionKey
-        * @return boolean
+        * @return bool
         */
        public function isAvailable($extensionKey) {
                return $this->packageManager->isPackageAvailable($extensionKey);
@@ -290,7 +291,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         */
        protected function saveDefaultConfiguration($extensionKey) {
                /** @var $configUtility \TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility */
-               $configUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\ConfigurationUtility');
+               $configUtility = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\ConfigurationUtility::class);
                $configUtility->saveDefaultConfiguration($extensionKey);
        }
 
@@ -307,13 +308,13 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        $diff = $this->installToolSqlParser->getDatabaseExtra($fieldDefinitionsFromFile, $fieldDefinitionsFromCurrentDatabase);
                        $updateStatements = $this->installToolSqlParser->getUpdateSuggestions($diff);
                        $db = $this->getDatabaseConnection();
-                       foreach ((array) $updateStatements['add'] as $string) {
+                       foreach ((array)$updateStatements['add'] as $string) {
                                $db->admin_query($string);
                        }
-                       foreach ((array) $updateStatements['change'] as $string) {
+                       foreach ((array)$updateStatements['change'] as $string) {
                                $db->admin_query($string);
                        }
-                       foreach ((array) $updateStatements['create_table'] as $string) {
+                       foreach ((array)$updateStatements['create_table'] as $string) {
                                $db->admin_query($string);
                        }
                }
@@ -399,7 +400,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         *
         * @internal
         * @param \TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData
-        * @return boolean
+        * @return bool
         */
        public function isUpdateAvailable(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension $extensionData) {
                $isUpdateAvailable = FALSE;
@@ -449,14 +450,15 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                        $importFileToUse = $possibleImportFile;
                }
                if ($importFileToUse !== NULL) {
-                       $importExportUtility = $this->objectManager->get('TYPO3\\CMS\\Impexp\\Utility\\ImportExportUtility');
+                       /** @var ImportExportUtility $importExportUtility */
+                       $importExportUtility = $this->objectManager->get(\TYPO3\CMS\Impexp\Utility\ImportExportUtility::class);
                        try {
                                $importResult = $importExportUtility->importT3DFile(PATH_site . $importFileToUse, 0);
                                $this->registry->set('extensionDataImport', $extensionSiteRelPath . 'Initialisation/dataImported', 1);
                                $this->emitAfterExtensionT3DImportSignal($importFileToUse, $importResult);
                        } catch (\ErrorException $e) {
                                /** @var \TYPO3\CMS\Core\Log\Logger $logger */
-                               $logger = $this->objectManager->get('TYPO3\\CMS\\Core\\Log\\LogManager')->getLogger(__CLASS__);
+                               $logger = $this->objectManager->get(\TYPO3\CMS\Core\Log\LogManager::class)->getLogger(__CLASS__);
                                $logger->log(\TYPO3\CMS\Core\Log\LogLevel::WARNING, $e->getMessage());
                        }
                }
@@ -466,9 +468,9 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         * Emits a signal after an t3d file was imported
         *
         * @param string $importFileToUse
-        * @param array $importResult
+        * @param int $importResult
         */
-       protected function emitAfterExtensionT3DImportSignal($importFileToUse, array $importResult) {
+       protected function emitAfterExtensionT3DImportSignal($importFileToUse, $importResult) {
                $this->signalSlotDispatcher->dispatch(__CLASS__, 'afterExtensionT3DImport', array($importFileToUse, $importResult, $this));
        }