[BUGFIX] Avoid constant TYPO3_site with TYPO3 9 LTS 57/58657/2
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 19 Oct 2018 02:58:21 +0000 (22:58 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 19 Oct 2018 03:00:01 +0000 (05:00 +0200)
Use TYPO3\CMS\Core\Core\Environment::getPublicPath when it exists.

Change-Id: I83dc71a320ac4984a9f48b6ddd5bcb44029c9da8
Resolves: #86694
Reviewed-on: https://review.typo3.org/58657
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/Domain/Repository/LanguagePackRepository.php

index 104222d..4d61d3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-18  Stanislas Rolland  <typo3(arobas)sjbr.ca>
+
+       * Resolves #86694: Avoid constant TYPO3_site with TYPO3 9 LTS
+
 2018-10-14  Stanislas Rolland  <typo3(arobas)sjbr.ca>
 
        * Resolves #86610: Add schema migration service and dumping utility
index a293fc8..4edd2df 100644 (file)
@@ -62,7 +62,7 @@ class LanguagePackRepository extends Repository
                $localeCamel = GeneralUtility::underscoredToUpperCamelCase(strtolower($locale));
 
                $languagePackExtensionKey = $extensionKey . '_' . $localeLowerCase;
-               $languagePackExtensionPath = PATH_site . 'typo3conf/ext/' . $languagePackExtensionKey . '/';
+               $languagePackExtensionPath = (class_exists(\TYPO3\CMS\Core\Core\Environment) ? (\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/') : PATH_site) . 'typo3conf/ext/' . $languagePackExtensionKey . '/';
 
                // Cleanup any pre-existing language pack
                if (is_dir($languagePackExtensionPath)) {
@@ -96,7 +96,7 @@ class LanguagePackRepository extends Repository
 
                // Get the source files of the language pack template
                $sourcePath = $extensionPath . 'Resources/Private/LanguagePackTemplate/';
-               $sourceFiles = array();
+               $sourceFiles = [];
                $sourceFiles = GeneralUtility::getAllFilesAndFoldersInPath($sourceFiles, $sourcePath);
                $sourceFiles = GeneralUtility::removePrefixPathFromList($sourceFiles, $sourcePath);
                // Set markers replacement values