From 6a7369d976274f0868b6aa3217e3fb42eab5e00f Mon Sep 17 00:00:00 2001 From: Stefan Neufeind Date: Mon, 1 Dec 2014 14:19:48 +0100 Subject: [PATCH] [TASK] Use name-resolution instead of strings where possible: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (part for extensions starting with "s") Use name-resolution with ...::class instead of strings where possible. (needs PHP 5.5, which is meanwhile required for master) Change-set Iedbb896607adddce2b23ab67f990fa2296c0d1bb first introduced usage of ::class in master. We now add it in various more places. Change-Id: I54a34f04bf9027051500f574d9760c80fafe05a9 Resolves: #63477 Releases: master Reviewed-on: http://review.typo3.org/34868 Reviewed-by: Alexander Opitz Tested-by: Alexander Opitz Reviewed-by: Frank Nägler Tested-by: Frank Nägler --- ...rbageCollectionAdditionalFieldProvider.php | 4 +- ...rbageCollectionAdditionalFieldProvider.php | 6 +-- .../Task/TableGarbageCollectionTask.php | 12 ++--- .../DevelopersGuide/CreatingTasks/Index.rst | 6 +-- .../SchedulerModuleControllerTest.php | 2 +- .../CachingFrameworkGarbageCollectionTest.php | 24 +++++----- typo3/sysext/scheduler/ext_localconf.php | 44 +++++++++---------- typo3/sysext/setup/ext_tables.php | 4 +- .../sv/Classes/AuthenticationService.php | 8 ++-- typo3/sysext/sv/ext_localconf.php | 8 ++-- typo3/sysext/sv/ext_tables.php | 2 +- 11 files changed, 60 insertions(+), 60 deletions(-) diff --git a/typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php b/typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php index 413e9ef72191..d70c0c31aa4d 100644 --- a/typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php +++ b/typo3/sysext/scheduler/Classes/Task/CachingFrameworkGarbageCollectionAdditionalFieldProvider.php @@ -36,8 +36,8 @@ class CachingFrameworkGarbageCollectionAdditionalFieldProvider implements \TYPO3 $taskInfo['scheduler_cachingFrameworkGarbageCollection_selectedBackends'] = array(); if ($parentObject->CMD === 'add') { // In case of new task, set to dbBackend if it's available - if (in_array('TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend', $this->getRegisteredBackends())) { - $taskInfo['scheduler_cachingFrameworkGarbageCollection_selectedBackends'][] = 'TYPO3\\CMS\\Core\\Cache\\Backend\\Typo3DatabaseBackend'; + if (in_array(\TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class, $this->getRegisteredBackends())) { + $taskInfo['scheduler_cachingFrameworkGarbageCollection_selectedBackends'][] = \TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend::class; } } elseif ($parentObject->CMD === 'edit') { // In case of editing the task, set to currently selected value diff --git a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php index 93ca5a06428f..4f2fbb85fde5 100644 --- a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php +++ b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionAdditionalFieldProvider.php @@ -49,7 +49,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu * @return void */ protected function initDefaultNumberOfDays() { - $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']; + $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']; foreach ($tableConfiguration as $tableName => $configuration) { if (isset($configuration['expirePeriod'])) { $this->defaultNumberOfDays[$tableName] = $configuration['expirePeriod']; @@ -92,7 +92,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu * @return array Array containing all the information pertaining to the additional fields */ protected function getTableAdditionalField(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) { - $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']; + $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']; $options = array(); // Add an empty option on top if an existing task is configured // with a table that can not be found in configuration anymore @@ -207,7 +207,7 @@ class TableGarbageCollectionAdditionalFieldProvider implements \TYPO3\CMS\Schedu */ public function validateTableAdditionalField(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject) { $validData = FALSE; - $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']; + $tableConfiguration = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']; if (!isset($submittedData['scheduler_tableGarbageCollection_table'])) { $validData = TRUE; } elseif (array_key_exists($submittedData['scheduler_tableGarbageCollection_table'], $tableConfiguration)) { diff --git a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php index b4ee4199fed1..0c3f2a73fc8e 100644 --- a/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php +++ b/typo3/sysext/scheduler/Classes/Task/TableGarbageCollectionTask.php @@ -20,7 +20,7 @@ namespace TYPO3\CMS\Scheduler\Task; * This task deletes rows from tables older than the given number of days. * * Available tables must be registered in - * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'] + * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'] * See ext_localconf.php of scheduler extension for an example * * @author Christian Kuhn @@ -49,7 +49,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask * @return bool TRUE if task run was successful */ public function execute() { - $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']; + $tableConfigurations = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']; $tableHandled = FALSE; foreach ($tableConfigurations as $tableName => $configuration) { if ($this->allTables || $tableName === $this->table) { @@ -58,7 +58,7 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask } } if (!$tableHandled) { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' misconfiguration: ' . $this->table . ' does not exist in configuration', 1308354399); } return TRUE; } @@ -83,18 +83,18 @@ class TableGarbageCollectionTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask $deleteTimestamp = strtotime('-' . $this->numberOfDays . 'days'); } else { if (!isset($configuration['expirePeriod'])) { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: No expirePeriod defined for table ' . $table, 1308355095); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' misconfiguration: No expirePeriod defined for table ' . $table, 1308355095); } $deleteTimestamp = strtotime('-' . $configuration['expirePeriod'] . 'days'); } $where = $configuration['dateField'] . ' < ' . $deleteTimestamp; } else { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask misconfiguration: Either expireField or dateField must be defined for table ' . $table, 1308355268); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' misconfiguration: Either expireField or dateField must be defined for table ' . $table, 1308355268); } $GLOBALS['TYPO3_DB']->exec_DELETEquery($table, $where); $error = $GLOBALS['TYPO3_DB']->sql_error(); if ($error) { - throw new \RuntimeException('TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask failed for table ' . $this->table . ' with error: ' . $error, 1308255491); + throw new \RuntimeException(\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class . ' failed for table ' . $this->table . ' with error: ' . $error, 1308255491); } return TRUE; } diff --git a/typo3/sysext/scheduler/Documentation/DevelopersGuide/CreatingTasks/Index.rst b/typo3/sysext/scheduler/Documentation/DevelopersGuide/CreatingTasks/Index.rst index 707aebb59f3a..c67cc78f90e5 100644 --- a/typo3/sysext/scheduler/Documentation/DevelopersGuide/CreatingTasks/Index.rst +++ b/typo3/sysext/scheduler/Documentation/DevelopersGuide/CreatingTasks/Index.rst @@ -275,11 +275,11 @@ task. Let's look at one of the base classes declaration as an example: :: // Add caching framework garbage collection task - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask'] = array( + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/locallang.xml:cachingFrameworkGarbageCollection.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionAdditionalFieldProvider::class ); The registration is made in the array @@ -328,7 +328,7 @@ simple as possible. Consider the following: class MyTask extends \TYPO3\CMS\Scheduler\Task\AbstractTask { public function execute() { - $businessLogic = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Vendor\\Extension\\BusinessLogic'); + $businessLogic = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Vendor\Extension\BusinessLogic::class); $businessLogic->run(arg1, arg2, …); } } diff --git a/typo3/sysext/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php b/typo3/sysext/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php index 12ac2f15227e..b7bd2351f514 100644 --- a/typo3/sysext/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php +++ b/typo3/sysext/scheduler/Tests/Unit/Controller/SchedulerModuleControllerTest.php @@ -32,7 +32,7 @@ class SchedulerModuleControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase { * @return void */ public function setUp() { - $this->testObject = $this->getMock('TYPO3\\CMS\\Scheduler\\Controller\\SchedulerModuleController', array('dummy'), array(), '', FALSE); + $this->testObject = $this->getMock(\TYPO3\CMS\Scheduler\Controller\SchedulerModuleController::class, array('dummy'), array(), '', FALSE); } /** diff --git a/typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php b/typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php index 83fbfc19e302..a0c7ac83d6ac 100644 --- a/typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php +++ b/typo3/sysext/scheduler/Tests/Unit/Task/CachingFrameworkGarbageCollectionTest.php @@ -46,21 +46,21 @@ class CachingFrameworkGarbageCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTe * @test */ public function executeCallsCollectGarbageOfConfiguredBackend() { - $cache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\StringFrontend', array(), array(), '', FALSE); + $cache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class, array(), array(), '', FALSE); $cache->expects($this->any())->method('getIdentifier')->will($this->returnValue('cache')); $cache->expects($this->atLeastOnce())->method('collectGarbage'); $mockCacheManager = new \TYPO3\CMS\Core\Cache\CacheManager(); $mockCacheManager->registerCache($cache); - GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager', $mockCacheManager); + GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager); $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] = array( 'cache' => array( - 'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\StringFrontend', - 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\AbstractBackend', + 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class, + 'backend' => \TYPO3\CMS\Core\Cache\Backend\AbstractBackend::class, ) ); /** @var \TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask|\PHPUnit_Framework_MockObject_MockObject $subject */ - $subject = $this->getMock('TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask', array('dummy'), array(), '', FALSE); - $subject->selectedBackends = array('TYPO3\\CMS\\Core\\Cache\\Backend\\AbstractBackend'); + $subject = $this->getMock(\TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask::class, array('dummy'), array(), '', FALSE); + $subject->selectedBackends = array(\TYPO3\CMS\Core\Cache\Backend\AbstractBackend::class); $subject->execute(); } @@ -68,21 +68,21 @@ class CachingFrameworkGarbageCollectionTest extends \TYPO3\CMS\Core\Tests\UnitTe * @test */ public function executeDoesNotCallCollectGarbageOfNotConfiguredBackend() { - $cache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\StringFrontend', array(), array(), '', FALSE); + $cache = $this->getMock(\TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class, array(), array(), '', FALSE); $cache->expects($this->any())->method('getIdentifier')->will($this->returnValue('cache')); $cache->expects($this->never())->method('collectGarbage'); $mockCacheManager = new \TYPO3\CMS\Core\Cache\CacheManager(); $mockCacheManager->registerCache($cache); - GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager', $mockCacheManager); + GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Cache\CacheManager::class, $mockCacheManager); $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] = array( 'cache' => array( - 'frontend' => 'TYPO3\\CMS\\Core\\Cache\\Frontend\\StringFrontend', - 'backend' => 'TYPO3\\CMS\\Core\\Cache\\Backend\\AbstractBackend', + 'frontend' => \TYPO3\CMS\Core\Cache\Frontend\StringFrontend::class, + 'backend' => \TYPO3\CMS\Core\Cache\Backend\AbstractBackend::class, ) ); /** @var \TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask|\PHPUnit_Framework_MockObject_MockObject $subject */ - $subject = $this->getMock('TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask', array('dummy'), array(), '', FALSE); - $subject->selectedBackends = array('TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend'); + $subject = $this->getMock(\TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask::class, array('dummy'), array(), '', FALSE); + $subject->selectedBackends = array(\TYPO3\CMS\Core\Cache\Backend\NullBackend::class); $subject->execute(); } diff --git a/typo3/sysext/scheduler/ext_localconf.php b/typo3/sysext/scheduler/ext_localconf.php index 9c917d70afc8..83085bbad637 100644 --- a/typo3/sysext/scheduler/ext_localconf.php +++ b/typo3/sysext/scheduler/ext_localconf.php @@ -11,83 +11,83 @@ $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['scheduler' // If sample tasks should be shown, // register information for the test and sleep tasks if (!empty($extConf['showSampleTasks'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Example\\TestTask'] = array( + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Example\TestTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:testTask.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:testTask.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Example\\TestTaskAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Example\TestTaskAdditionalFieldProvider::class ); - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Example\\SleepTask'] = array( + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Example\SleepTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:sleepTask.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:sleepTask.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Example\\SleepTaskAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Example\SleepTaskAdditionalFieldProvider::class ); } // Add caching framework garbage collection task -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionTask'] = array( +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:cachingFrameworkGarbageCollection.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:cachingFrameworkGarbageCollection.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\CachingFrameworkGarbageCollectionAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\CachingFrameworkGarbageCollectionAdditionalFieldProvider::class ); // Add task to index file in a storage -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\FileStorageIndexingTask'] = array( +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\FileStorageIndexingTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:fileStorageIndexing.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:fileStorageIndexing.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\FileStorageIndexingAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\FileStorageIndexingAdditionalFieldProvider::class ); // Add task for extracting metadata from files in a storage -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\FileStorageExtractionTask'] = array( +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\FileStorageExtractionTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:fileStorageExtraction.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:fileStorageExtraction.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\FileStorageExtractionAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\FileStorageExtractionAdditionalFieldProvider::class ); // Add recycler directory cleanup task. Windows is not supported // because "filectime" does not change after moving a file if (TYPO3_OS !== 'WIN') { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\RecyclerGarbageCollectionTask'] = array( + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\RecyclerGarbageCollectionTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:recyclerGarbageCollection.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:recyclerGarbageCollection.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\RecyclerGarbageCollectionAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\RecyclerGarbageCollectionAdditionalFieldProvider::class ); } // Add table garbage collection task -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask'] = array( +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class] = array( 'extension' => $_EXTKEY, 'title' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:tableGarbageCollection.name', 'description' => 'LLL:EXT:' . $_EXTKEY . '/Resources/Private/Language/locallang.xlf:tableGarbageCollection.description', - 'additionalFields' => 'TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionAdditionalFieldProvider' + 'additionalFields' => \TYPO3\CMS\Scheduler\Task\TableGarbageCollectionAdditionalFieldProvider::class ); // Initialize option array of table garbage collection task if not already done by some other extension or localconf.php -if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options'] = array(); +if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options'] = array(); } -if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables'] = array(); +if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables'] = array(); } // Register sys_log and sys_history table in table garbage collection task -if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_log'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_log'] = array( +if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_log'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_log'] = array( 'dateField' => 'tstamp', 'expirePeriod' => 180 ); } -if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_history'])) { - $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks']['TYPO3\\CMS\\Scheduler\\Task\\TableGarbageCollectionTask']['options']['tables']['sys_history'] = array( +if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_history'])) { + $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][\TYPO3\CMS\Scheduler\Task\TableGarbageCollectionTask::class]['options']['tables']['sys_history'] = array( 'dateField' => 'tstamp', 'expirePeriod' => 30 ); diff --git a/typo3/sysext/setup/ext_tables.php b/typo3/sysext/setup/ext_tables.php index 0a69357fb160..bdcef681781d 100644 --- a/typo3/sysext/setup/ext_tables.php +++ b/typo3/sysext/setup/ext_tables.php @@ -46,13 +46,13 @@ if (TYPO3_MODE === 'BE') { ), 'lang' => array( 'type' => 'select', - 'itemsProcFunc' => 'TYPO3\\CMS\\Setup\\Controller\\SetupModuleController->renderLanguageSelect', + 'itemsProcFunc' => \TYPO3\CMS\Setup\Controller\SetupModuleController::class . '->renderLanguageSelect', 'label' => 'LLL:EXT:setup/mod/locallang.xlf:language', 'csh' => 'language' ), 'startModule' => array( 'type' => 'select', - 'itemsProcFunc' => 'TYPO3\\CMS\\Setup\\Controller\\SetupModuleController->renderStartModuleSelect', + 'itemsProcFunc' => \TYPO3\CMS\Setup\Controller\SetupModuleController::class . '->renderStartModuleSelect', 'label' => 'LLL:EXT:setup/mod/locallang.xlf:startModule', 'csh' => 'startModule' ), diff --git a/typo3/sysext/sv/Classes/AuthenticationService.php b/typo3/sysext/sv/Classes/AuthenticationService.php index d5ff24cd465d..e05c341ab19d 100644 --- a/typo3/sysext/sv/Classes/AuthenticationService.php +++ b/typo3/sysext/sv/Classes/AuthenticationService.php @@ -74,7 +74,7 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog(sprintf('Login-attempt from %s (%s), username \'%s\' not found!', $this->authInfo['REMOTE_ADDR'], $this->authInfo['REMOTE_HOST'], $this->login['uname']), 'Core', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING); } else { if ($this->writeDevLog) { - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('User found: ' . \TYPO3\CMS\Core\Utility\GeneralUtility::arrayToLogString($user, array($this->db_user['userid_column'], $this->db_user['username_column'])), 'TYPO3\\CMS\\Sv\\AuthenticationService'); + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('User found: ' . \TYPO3\CMS\Core\Utility\GeneralUtility::arrayToLogString($user, array($this->db_user['userid_column'], $this->db_user['username_column'])), \TYPO3\CMS\Sv\AuthenticationService::class); } } } else { @@ -111,7 +111,7 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService \TYPO3\CMS\Core\Utility\GeneralUtility::sysLog(sprintf('Login-attempt from %s (%s), username \'%s\', password not accepted!', $this->authInfo['REMOTE_ADDR'], $this->authInfo['REMOTE_HOST'], $this->login['uname']), 'Core', \TYPO3\CMS\Core\Utility\GeneralUtility::SYSLOG_SEVERITY_WARNING); } if ($this->writeDevLog) { - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Password not accepted: ' . $this->login['uident'], 'TYPO3\\CMS\\Sv\\AuthenticationService', 2); + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Password not accepted: ' . $this->login['uident'], \TYPO3\CMS\Sv\AuthenticationService::class, 2); } } // Checking the domain (lockToDomain) @@ -155,7 +155,7 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService if (count($groups)) { $list = implode(',', $groups); if ($this->writeDevLog) { - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Get usergroups with id: ' . $list, 'TYPO3\\CMS\\Sv\\AuthenticationService'); + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('Get usergroups with id: ' . $list, \TYPO3\CMS\Sv\AuthenticationService::class); } $lockToDomain_SQL = ' AND (lockToDomain=\'\' OR lockToDomain IS NULL OR lockToDomain=\'' . $this->authInfo['HTTP_HOST'] . '\')'; if (!$this->authInfo['showHiddenRecords']) { @@ -170,7 +170,7 @@ class AuthenticationService extends \TYPO3\CMS\Sv\AbstractAuthenticationService } } else { if ($this->writeDevLog) { - \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('No usergroups found.', 'TYPO3\\CMS\\Sv\\AuthenticationService', 2); + \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('No usergroups found.', \TYPO3\CMS\Sv\AuthenticationService::class, 2); } } } elseif ($this->mode == 'getGroupsBE') { diff --git a/typo3/sysext/sv/ext_localconf.php b/typo3/sysext/sv/ext_localconf.php index 10323ace3862..601fe6fedfc2 100644 --- a/typo3/sysext/sv/ext_localconf.php +++ b/typo3/sysext/sv/ext_localconf.php @@ -5,7 +5,7 @@ defined('TYPO3_MODE') or die(); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService( $_EXTKEY, 'auth', - 'TYPO3\\CMS\\Sv\\AuthenticationService', + \TYPO3\CMS\Sv\AuthenticationService::class, array( 'title' => 'User authentication', 'description' => 'Authentication with username/password.', @@ -15,9 +15,9 @@ defined('TYPO3_MODE') or die(); 'quality' => 50, 'os' => '', 'exec' => '', - 'className' => 'TYPO3\\CMS\\Sv\\AuthenticationService' + 'className' => \TYPO3\CMS\Sv\AuthenticationService::class ) ); // Add hooks to the backend login form -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'][$_EXTKEY] = 'TYPO3\\CMS\\Sv\\LoginFormHook->getLoginFormTag'; -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'][$_EXTKEY] = 'TYPO3\\CMS\\Sv\\LoginFormHook->getLoginScripts'; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'][$_EXTKEY] = \TYPO3\CMS\Sv\LoginFormHook::class . '->getLoginFormTag'; +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'][$_EXTKEY] = \TYPO3\CMS\Sv\LoginFormHook::class . '->getLoginScripts'; diff --git a/typo3/sysext/sv/ext_tables.php b/typo3/sysext/sv/ext_tables.php index 336f216c0b00..db064f628133 100644 --- a/typo3/sysext/sv/ext_tables.php +++ b/typo3/sysext/sv/ext_tables.php @@ -6,6 +6,6 @@ if (TYPO3_MODE === 'BE') { 'title' => 'LLL:EXT:sv/Resources/Private/Language/locallang.xlf:report_title', 'description' => 'LLL:EXT:sv/Resources/Private/Language/locallang.xlf:report_description', 'icon' => 'EXT:sv/Resources/Public/Images/service-reports.png', - 'report' => 'TYPO3\\CMS\\Sv\\Report\\ServicesListReport' + 'report' => \TYPO3\CMS\Sv\Report\ServicesListReport::class ); } -- 2.20.1