Commit d4f55cd9 authored by Markus Klein's avatar Markus Klein
Browse files

[BUGFIX] Make FileService PHP7 compatible

parent 54757ce4
...@@ -365,13 +365,13 @@ class ConfigurationService extends AbstractService { ...@@ -365,13 +365,13 @@ class ConfigurationService extends AbstractService {
} }
/** @var \SGalinski\Lfeditor\Service\FileService $originalFileObject */ /** @var \SGalinski\Lfeditor\Service\FileService $originalFileObject */
$originalFileObject = $this->objectManager->get($className); $originalFileObject = $this->objectManager->get($className);
$originalFileObject->init($langFile, $extPath); $originalFileObject->init($langFile, $extPath, '');
try { try {
if ($this->session->getDataByKey('editingMode') === 'override') { if ($this->session->getDataByKey('editingMode') === 'override') {
/** @var FileOverrideService $overrideFileObj */ /** @var FileOverrideService $overrideFileObj */
$overrideFileObj = $this->objectManager->get('SGalinski\Lfeditor\Service\FileOverrideService'); $overrideFileObj = $this->objectManager->get('SGalinski\Lfeditor\Service\FileOverrideService');
$overrideFileObj->init($originalFileObject); $overrideFileObj->init($originalFileObject, '', '');
$this->fileObj = $overrideFileObj; $this->fileObj = $overrideFileObj;
} else { } else {
$this->fileObj = $originalFileObject; $this->fileObj = $originalFileObject;
...@@ -719,4 +719,4 @@ class ConfigurationService extends AbstractService { ...@@ -719,4 +719,4 @@ class ConfigurationService extends AbstractService {
} }
return $languages; return $languages;
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -73,7 +73,7 @@ class FileBackupService extends FileService { ...@@ -73,7 +73,7 @@ class FileBackupService extends FileService {
public function init($file, $path, $metaFile) { public function init($file, $path, $metaFile) {
// init // init
$this->setVar(array('metaFile' => $metaFile)); $this->setVar(array('metaFile' => $metaFile));
parent::init($file, $path); parent::init($file, $path, $metaFile);
// read meta file // read meta file
try { try {
......
...@@ -41,9 +41,9 @@ class FileBasePHPService extends FileBaseService { ...@@ -41,9 +41,9 @@ class FileBasePHPService extends FileBaseService {
* @param string $path path to the file * @param string $path path to the file
* @return void * @return void
*/ */
public function init($file, $path) { public function init($file, $path, $metaFile) {
$this->setVar(array('fileType' => 'php')); $this->setVar(array('fileType' => 'php'));
parent::init($file, $path); parent::init($file, $path, $metaFile);
} }
/** /**
......
...@@ -71,7 +71,7 @@ abstract class FileBaseService extends FileService { ...@@ -71,7 +71,7 @@ abstract class FileBaseService extends FileService {
* @param string $path path to the file * @param string $path path to the file
* @return void * @return void
*/ */
public function init($file, $path) { public function init($file, $path, $metaFile) {
if (class_exists('TYPO3\CMS\Core\Localization\Locales')) { if (class_exists('TYPO3\CMS\Core\Localization\Locales')) {
/** @var $locales Locales */ /** @var $locales Locales */
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales'); $locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
...@@ -86,7 +86,7 @@ abstract class FileBaseService extends FileService { ...@@ -86,7 +86,7 @@ abstract class FileBaseService extends FileService {
} }
$this->setWorkspace('base'); $this->setWorkspace('base');
parent::init($file, $path); parent::init($file, $path, $metaFile);
$this->prepareLanguageFilesForFirstUsage(); $this->prepareLanguageFilesForFirstUsage();
} }
......
...@@ -43,9 +43,9 @@ class FileBaseXLFService extends FileBaseService { ...@@ -43,9 +43,9 @@ class FileBaseXLFService extends FileBaseService {
* @param string $path path to the file * @param string $path path to the file
* @return void * @return void
*/ */
public function init($file, $path) { public function init($file, $path, $metaFile) {
$this->setFileType('xlf'); $this->setFileType('xlf');
parent::init($file, $path); parent::init($file, $path, $metaFile);
} }
/** /**
......
...@@ -45,9 +45,9 @@ class FileBaseXMLService extends FileBaseService { ...@@ -45,9 +45,9 @@ class FileBaseXMLService extends FileBaseService {
* @param string $path path to the file * @param string $path path to the file
* @return void * @return void
*/ */
public function init($file, $path) { public function init($file, $path, $metaFile) {
$this->setVar(array('fileType' => 'xml')); $this->setVar(array('fileType' => 'xml'));
parent::init($file, $path); parent::init($file, $path, $metaFile);
} }
/** /**
......
...@@ -47,7 +47,7 @@ class FileOverrideService extends FileBaseXMLService { ...@@ -47,7 +47,7 @@ class FileOverrideService extends FileBaseXMLService {
* @param FileService $originalFileObject * @param FileService $originalFileObject
* @return void * @return void
*/ */
public function init(FileService $originalFileObject) { public function init($originalFileObject, $path, $metaFile) {
try { try {
$typo3ExtRelativeFilePath = Typo3Lib::transTypo3File($originalFileObject->getAbsFile(), FALSE); $typo3ExtRelativeFilePath = Typo3Lib::transTypo3File($originalFileObject->getAbsFile(), FALSE);
} catch (\Exception $e) { } catch (\Exception $e) {
...@@ -70,7 +70,7 @@ class FileOverrideService extends FileBaseXMLService { ...@@ -70,7 +70,7 @@ class FileOverrideService extends FileBaseXMLService {
} }
$this->originalFileObject = $originalFileObject; $this->originalFileObject = $originalFileObject;
parent::init(basename($overrideFileAbsolutePath), dirname($overrideFileAbsolutePath)); parent::init(basename($overrideFileAbsolutePath), dirname($overrideFileAbsolutePath), $metaFile);
} }
/** /**
......
...@@ -98,7 +98,7 @@ abstract class FileService extends AbstractService { ...@@ -98,7 +98,7 @@ abstract class FileService extends AbstractService {
* @param string $path absolute path to the extension or language file * @param string $path absolute path to the extension or language file
* @return void * @return void
*/ */
public function init($file, $path) { public function init($file, $path, $metaFile) {
$this->setAbsPath($path); $this->setAbsPath($path);
$this->setRelFile($file); $this->setRelFile($file);
$this->setAbsFile($this->absPath . '/' . $this->relFile); $this->setAbsFile($this->absPath . '/' . $this->relFile);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment