[TASK] Make cli_dispatch and cli phpunit to run again
authorThomas Maroschik <tmaroschik@dfau.de>
Fri, 24 Aug 2012 11:21:34 +0000 (13:21 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 24 Aug 2012 11:44:23 +0000 (13:44 +0200)
Change-Id: I8dec97913250c253f7331378bbf1d9ab46905252
Resolves: #40114
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14030
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/classes/Bootstrap/Cli.php
typo3/cli_dispatch.phpsh
typo3/sysext/core/Classes/Autoloader.php

index 559e94f..0d199bb 100644 (file)
@@ -4,5 +4,5 @@
  * and will be removed by 7.0. The class was renamed and is now located at:
  * typo3/sysext/cli/Classes/CliBootstrap.php
  */
-require_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('cli') . 'Classes/CliBootstrap.php';
+require_once __DIR__ . '/../../sysext/cli/Classes/CliBootstrap.php';
 ?>
\ No newline at end of file
index ffbc138..50a7c4f 100755 (executable)
@@ -42,11 +42,12 @@ define('TYPO3_cliMode', TRUE);
 
        // We use require instead of require_once here so we get a fatal error if classes/Bootstrap.php is accidentally included twice
        // (which would indicate a clear bug).
-require('classes/Bootstrap/Cli.php');
-Typo3_Bootstrap_Cli::checkEnvironmentOrDie();
+require __DIR__ . '/sysext/cli/Classes/CliBootstrap.php';
+\TYPO3\CMS\Cli\CliBootstrap::checkEnvironmentOrDie();
 
-require('classes/Bootstrap.php');
-Typo3_Bootstrap::getInstance()
+require __DIR__ . '/sysext/core/Classes/Core/SystemEnvironmentBuilder.php';
+require __DIR__ . '/sysext/core/Classes/Core/Bootstrap.php';
+\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->baseSetup('typo3/')
        ->registerExtDirectComponents()
        ->populateLocalConfiguration()
@@ -74,22 +75,22 @@ Typo3_Bootstrap::getInstance()
        ->defineLoggingAndExceptionConstants()
        ->unsetReservedGlobalVariables()
        ->initializeTypo3DbGlobal(TRUE);
-Typo3_Bootstrap_Cli::initializeCliKeyOrDie();
-Typo3_Bootstrap::getInstance()
+\TYPO3\CMS\Cli\CliBootstrap::initializeCliKeyOrDie();
+\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->loadExtensionTables(TRUE)
        ->initializeBackendUser()
        ->initializeBackendUserMounts()
        ->initializeLanguageObject();
 
        // Make sure output is not buffered, so command-line output and interaction can take place
-t3lib_div::flushOutputBuffers();
+\TYPO3\CMS\Core\Utility\GeneralUtility::flushOutputBuffers();
 
 try {
        include(TYPO3_cliInclude);
-} catch (Exception $e) {
+} catch (\Exception $e) {
        fwrite(STDERR, $e->getMessage() . LF);
        exit(99);
 }
 
-Typo3_Bootstrap::getInstance()->shutdown();
+\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->shutdown();
 ?>
\ No newline at end of file
index 4405cab..e30814b 100644 (file)
@@ -288,7 +288,8 @@ class Autoloader {
                        try {
                                // This will throw a BadFunctionCallException if the extension is not loaded
                                $extensionPath = \TYPO3\CMS\Core\Extension\ExtensionManager::extPath($extensionKey);
-                               $classFilePathAndName = (($extensionPath . 'Classes/') . strtr($classNameWithoutVendorAndProduct, $delimiter, '/')) . '.php';
+                               $classPath = (substr(strtolower($classNameWithoutVendorAndProduct), 0, 5) === 'tests') ? '' : 'Classes/';
+                               $classFilePathAndName = (($extensionPath . $classPath) . strtr($classNameWithoutVendorAndProduct, $delimiter, '/')) . '.php';
                                self::addClassToCache($classFilePathAndName, $className);
                        } catch (\BadFunctionCallException $exception) {