[TASK] Remove classFile option from services 50/11150/5
authorBenjamin Mack <benni@typo3.org>
Sat, 12 May 2012 01:43:18 +0000 (20:43 -0500)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 1 Feb 2013 14:54:57 +0000 (15:54 +0100)
When using services (sv), one had to add "classFile" to the info
array when registering a service in order to find the entered
className. As this is now completely taken care of by the autoloader,
the option is obsolete and is now deprecated.

Note that once this is in, the documentation needs to be adjusted
as well.

Change-Id: Ic8817c80f7646e071ba71fa498972b70115715c5
Releases: 6.1
Resolves: #37115
Reviewed-on: https://review.typo3.org/11150
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/openid/ext_localconf.php
typo3/sysext/rsaauth/ext_localconf.php
typo3/sysext/saltedpasswords/ext_localconf.php
typo3/sysext/sv/ext_localconf.php

index abeb964..45a6c5e 100644 (file)
@@ -4362,27 +4362,37 @@ Connection: close
                                $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']]->reset();
                                return $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']];
                        } else {
-                               $requireFile = self::getFileAbsFileName($info['classFile']);
-                               if (@is_file($requireFile)) {
-                                       self::requireOnce($requireFile);
-                                       $obj = self::makeInstance($info['className']);
-                                       if (is_object($obj)) {
-                                               if (!@is_callable(array($obj, 'init'))) {
-                                                       // use silent logging??? I don't think so.
-                                                       die('Broken service:' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($info));
-                                               }
-                                               $obj->info = $info;
-                                               // service available?
-                                               if ($obj->init()) {
-                                                       // create persistent object
-                                                       $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
-                                                       // needed to delete temp files
-                                                       register_shutdown_function(array(&$obj, '__destruct'));
-                                                       return $obj;
-                                               }
-                                               $error = $obj->getLastErrorArray();
-                                               unset($obj);
+                               if (isset($info['classFile'])) {
+                                       // @deprecated since 6.1, will be removed in TYPO3 CMS 6.3
+                                       // Option is deprecated, since we now have the autoloader function
+                                       self::deprecationLog(
+                                               'The option "classFile" of "' . $info['className'] .
+                                               '" in T3_SERVICES has been deprecated, as this should now be done by the respective ' .
+                                               'ext_autoload.php of each extension. This option will be removed in TYPO3 CMS v6.3.'
+                                       );
+                                       $requireFile = self::getFileAbsFileName($info['classFile']);
+                                       if (@is_file($requireFile)) {
+                                               self::requireOnce($requireFile);
+                                       }
+                               }
+
+                               $obj = self::makeInstance($info['className']);
+                               if (is_object($obj)) {
+                                       if (!@is_callable(array($obj, 'init'))) {
+                                               // use silent logging??? I don't think so.
+                                               die('Broken service:' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($info));
+                                       }
+                                       $obj->info = $info;
+                                       // service available?
+                                       if ($obj->init()) {
+                                               // create persistent object
+                                               $GLOBALS['T3_VAR']['makeInstanceService'][$info['className']] = $obj;
+                                               // needed to delete temp files
+                                               register_shutdown_function(array(&$obj, '__destruct'));
+                                               return $obj;
                                        }
+                                       $error = $obj->getLastErrorArray();
+                                       unset($obj);
                                }
                        }
                        // deactivate the service
index 742128c..9685ad7 100644 (file)
@@ -14,9 +14,9 @@ if (!defined('TYPO3_MODE')) {
        'quality' => 50,
        'os' => '',
        'exec' => '',
-       'classFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'sv1/class.tx_openid_sv1.php',
        'className' => 'TYPO3\\CMS\\Openid\\OpenidService'
 ));
+
 // Register eID script that performs final FE user authentication. It will be called by the OpenID provider
 $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_openid'] = 'EXT:openid/class.tx_openid_eid.php';
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['setup']['accessLevelCheck']['TYPO3\\CMS\\Openid\\OpenidModuleSetup'] = 'EXT:openid/class.tx_openid_mod_setup.php';
index 3bbb9f1..ac4a39a 100644 (file)
@@ -15,9 +15,9 @@ if (!defined('TYPO3_MODE')) {
        'os' => '',
        'exec' => '',
        // Do not put a dependency on openssh here or service loading will fail!
-       'classFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'sv1/class.tx_rsaauth_sv1.php',
        'className' => 'TYPO3\\CMS\\Rsaauth\\RsaAuthService'
 ));
+
 // Add a hook to the BE login form
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginFormHook'][$_EXTKEY] = 'EXT:' . $_EXTKEY . '/hooks/class.tx_rsaauth_loginformhook.php:TYPO3\\CMS\\Rsaauth\\Hook\\LoginFormHook->getLoginFormTag';
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/index.php']['loginScriptHook'][$_EXTKEY] = 'EXT:' . $_EXTKEY . '/hooks/class.tx_rsaauth_loginformhook.php:TYPO3\\CMS\\Rsaauth\\Hook\\LoginFormHook->getLoginScripts';
index f6c5c8c..5c5bd72 100644 (file)
@@ -14,6 +14,7 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/saltedpasswords']['saltMethods']
        'TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt' => 'EXT:saltedpasswords/Classes/salts/class.tx_saltedpasswords_salts_blowfish.php:TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt',
        'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt' => 'EXT:saltedpasswords/Classes/salts/class.tx_saltedpasswords_salts_phpass.php:TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt'
 );
+
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addService('saltedpasswords', 'auth', 'TYPO3\\CMS\\Saltedpasswords\\SaltedPasswordService', array(
        'title' => 'FE/BE Authentification salted',
        'description' => 'Salting of passwords for Frontend and Backend',
@@ -24,9 +25,9 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/saltedpasswords']['saltMethods']
        'quality' => 70,
        'os' => '',
        'exec' => '',
-       'classFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('saltedpasswords') . 'sv1/class.tx_saltedpasswords_sv1.php',
        'className' => 'TYPO3\\CMS\\Saltedpasswords\\SaltedPasswordService'
 ));
+
 // Use popup window to refresh login instead of the AJAX relogin:
 $TYPO3_CONF_VARS['BE']['showRefreshLoginPopup'] = 1;
 // Register bulk update task
index 84f7378..618b696 100644 (file)
@@ -12,7 +12,6 @@ if (!defined('TYPO3_MODE')) {
        'quality' => 50,
        'os' => '',
        'exec' => '',
-       'classFile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'class.tx_sv_auth.php',
        'className' => 'TYPO3\\CMS\\Sv\\AuthenticationService'
 ));
 // Add hooks to the backend login form