Project

General

Profile

Bug #67221

Updated by Markus Klein over 9 years ago

Under some circumstances class loading fails with the following error: 
 <pre> 
 PHP Fatal error:    Cannot use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtility because the name is already in use in /var/www/t3_plansee/htdocs/typo3conf/ext/news/Classes/Hooks/DataHandler.php on line 18 
 </pre> 

 This is because of line 18 in the DataHandler.php: @use TYPO3\CMS\Backend\Utility\BackendUtility@ use TYPO3\CMS\Backend\Utility\BackendUtility 

 After removing line 18 and replacing the BackendUtility class with the full qualified name it works. 

 One way to produce this error is to call l10nmgr import cli with php-cgi: 
 @"php-cgi" "php-cgi" -q -e -d register_argc_argv=1 "cli_dispatch.phpsh" l10nmgr_import --task importFile --preview 1 --file trans.xml --server "http://URL/"@ "http://URL/" 

 The error occures in the TYPO3\CMS\Core\Core\ClassLoader->loadClass() method in line 197 (typo3 6.2.12: 
 <pre> 
 || 6.2.12:|| (bool)require_once $classLoadingInformation[0];): 
		 if (!empty($classLoadingInformation)) { 
			    // The call to class_exists/interface_exists fixes a rare case when early instances need to be aliased 
			    // but PHP fails to recognize the real path of the class. See #55904 
			    $loadingSuccessful = class_exists($classLoadingInformation[1], FALSE) 
				       || interface_exists($classLoadingInformation[1], FALSE) 
				       || (bool)require_once $classLoadingInformation[0]; 
		 } 
 </pre> 
 

 I think it has something to do with the extensions BackendUtility class.

Back