Skip to content

Commit

Permalink
Merge pull request #141 from maddy2101/master
Browse files Browse the repository at this point in the history
Revert "[BUGFIX] Add compatibility to TYPO3 Core v9"
  • Loading branch information
bmack committed Jun 18, 2019
2 parents 675c7d0 + 8e3c796 commit 63a0f97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 35 deletions.
24 changes: 1 addition & 23 deletions Classes/Core/Testbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
*/
class Testbase
{
/**
* Usually contains the major version of TYPO3 Core
* @var int
*/
private $coreVersion;

/**
* This class must be called in CLI environment as a security measure
* against path disclosures and other stuff. Check this within
Expand All @@ -60,11 +54,6 @@ public function __construct()
if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
die('This script supports command line usage only. Please check your command.');
}
if (class_exists(\TYPO3\CMS\Frontend\Page\PageGenerator::class)) {
$this->coreVersion = 9;
} else {
$this->coreVersion = 10;
}
}

/**
Expand Down Expand Up @@ -101,13 +90,7 @@ public function defineBaseConstants()
*/
public function defineSitePath()
{
if ($this->coreVersion === 9) {
define('PATH_site', $this->getWebRoot());
define('PATH_thisScript', PATH_site . 'typo3/index.php');
$_SERVER['SCRIPT_NAME'] = PATH_thisScript;
} else {
$_SERVER['SCRIPT_NAME'] = $this->getWebRoot() . 'typo3/index.php';
}
$_SERVER['SCRIPT_NAME'] = $this->getWebRoot() . 'typo3/index.php';
if (!file_exists($_SERVER['SCRIPT_NAME'])) {
$this->exitWithMessage('Unable to determine path to entry script. Please check your path or set an environment variable \'TYPO3_PATH_ROOT\' to your root path.');
}
Expand Down Expand Up @@ -918,11 +901,6 @@ protected function resolvePath(string $path)
return $path;
}

public function getCurrentTypo3Version(): int
{
return $this->coreVersion;
}

/**
* Writes $content to the file $file. This is a simplified version
* of GeneralUtility::writeFile that does not fix permissions.
Expand Down
7 changes: 2 additions & 5 deletions Resources/Core/Build/UnitTestsBootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
call_user_func(function () {
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
$testbase->enableDisplayErrors();
$testbase->defineBaseConstants();

// These if's are for core testing (package typo3/cms) only. cms-composer-installer does
// not create the autoload-include.php file that sets these env vars and sets composer
Expand Down Expand Up @@ -56,10 +57,6 @@
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/tests');
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/typo3temp/var/transient');

if ($testbase->getCurrentTypo3Version() === 9) {
$testbase->createDirectory(\TYPO3\CMS\Core\Core\Environment::getPublicPath() . '/uploads');
}

// Retrieve an instance of class loader and inject to core bootstrap
$classLoader = require $testbase->getPackagesPath() . '/autoload.php';
\TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader($classLoader);
Expand All @@ -73,7 +70,7 @@
$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '.*';

$cache = new \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend(
($testbase->getCurrentTypo3Version() === 9 ? 'cache_core' : 'core'),
'core',
new \TYPO3\CMS\Core\Cache\Backend\NullBackend('production', [])
);
// Set all packages to active
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"phpunit/phpunit": "^7.5.6 || ^8",
"mikey179/vfsstream": "~1.6.0",
"typo3fluid/fluid": "^2.5",
"typo3/cms-core": "^9.5 || 10.*.*@dev",
"typo3/cms-backend": "^9.5 || 10.*.*@dev",
"typo3/cms-frontend": "^9.5 || 10.*.*@dev",
"typo3/cms-extbase": "^9.5 || 10.*.*@dev",
"typo3/cms-fluid": "^9.5 || 10.*.*@dev",
"typo3/cms-recordlist": "^9.5 || 10.*.*@dev"
"typo3/cms-core": "10.*.*@dev",
"typo3/cms-backend": "10.*.*@dev",
"typo3/cms-frontend": "10.*.*@dev",
"typo3/cms-extbase": "10.*.*@dev",
"typo3/cms-fluid": "10.*.*@dev",
"typo3/cms-recordlist": "10.*.*@dev"
},
"suggest": {
"codeception/codeception": "^3",
"typo3/cms-styleguide": "^9.0 || 10.*.*@dev"
"typo3/cms-styleguide": "^9.0"
},
"config": {
"vendor-dir": ".Build/vendor",
Expand Down

0 comments on commit 63a0f97

Please sign in to comment.