Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Make compatible with TYPO3 8LTS #451

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 5 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,17 @@ matrix:
- php: 7.0
env: TYPO3_VERSION=^7.6
- php: 7.0
env: TYPO3_VERSION=~8.3.0
env: TYPO3_VERSION=^8.7
- php: 7.0
env: TYPO3_VERSION=~8.4.0
- php: 7.0
env: TYPO3_VERSION=~8.5.0
- php: 7.0
env: TYPO3_VERSION=~8.6.0
- php: 7.0
env: TYPO3_VERSION="dev-master as 8.6.0"
env: TYPO3_VERSION="dev-master as 8.7.0"
- php: 7.1
env: TYPO3_VERSION=^7.6
- php: 7.1
env: TYPO3_VERSION=^8
env: TYPO3_VERSION=^8.7
- php: 7.1
env: TYPO3_VERSION="dev-master as 8.6.0"
env: TYPO3_VERSION="dev-master as 8.7.0"
allow_failures:
- env: TYPO3_VERSION="dev-master as 8.6.0"
- env: TYPO3_VERSION="dev-master as 8.7.0"

cache:
directories:
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/InstallCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function environmentAndFoldersCommand()
*/
public function databaseConnectCommand($databaseUserName = '', $databaseUserPassword = '', $databaseHostName = 'localhost', $databasePort = '3306', $databaseSocket = '')
{
$this->executeActionWithArguments('databaseConnect', ['host' => $databaseHostName, 'port' => $databasePort, 'username' => $databaseUserName, 'password' => $databaseUserPassword, 'socket' => $databaseSocket]);
$this->executeActionWithArguments('databaseConnect', ['host' => $databaseHostName, 'port' => $databasePort, 'username' => $databaseUserName, 'password' => $databaseUserPassword, 'socket' => $databaseSocket, 'driver' => 'mysqli']);
}

/**
Expand Down
37 changes: 0 additions & 37 deletions Classes/Install/CliSetupRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
use Helhum\Typo3Console\Mvc\Cli\CommandDispatcher;
use Helhum\Typo3Console\Mvc\Cli\CommandManager;
use Helhum\Typo3Console\Mvc\Cli\ConsoleOutput;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Cli\CommandArgumentDefinition;
use TYPO3\CMS\Extbase\Mvc\Controller\Argument;
use TYPO3\CMS\Extbase\Mvc\Controller\Arguments;
use TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Reflection\ReflectionService;
use TYPO3\CMS\Install\Controller\Exception\RedirectException;
use TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService;
use TYPO3\CMS\Install\Status\StatusInterface;

/**
Expand Down Expand Up @@ -118,7 +115,6 @@ public function setup($interactiveSetup, array $givenRequestArguments)

foreach ($this->installationActions as $actionName) {
$this->dispatchAction($actionName);
$this->executeSilentConfigurationUpgradesIfNeeded();
}
}

Expand Down Expand Up @@ -275,39 +271,6 @@ private function getCommandMethodArguments($commandMethodName)
return $arguments;
}

/**
* Call silent upgrade class, redirect to self if configuration was changed.
*
* @throws RedirectException
* @return void
*/
protected function executeSilentConfigurationUpgradesIfNeeded()
{
$upgradeService = $this->objectManager->get(SilentConfigurationUpgradeService::class);
$count = 0;
do {
try {
$count++;
$upgradeService->execute();
$redirect = false;
} catch (RedirectException $e) {
$redirect = true;
$this->reloadConfiguration();
if ($count > 20) {
throw $e;
}
}
} while ($redirect === true);
}

/**
* Fetch the new configuration and expose it to the global array
*/
protected function reloadConfiguration()
{
GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class)->exportConfiguration();
}

// Logging and output related stuff
// TODO: Move to own class

Expand Down
39 changes: 39 additions & 0 deletions Classes/Install/InstallStepActionExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
*
*/

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Install\Controller\Action\ActionInterface;
use TYPO3\CMS\Install\Controller\Action\Step\StepInterface;
use TYPO3\CMS\Install\Controller\Exception\RedirectException;
use TYPO3\CMS\Install\Service\SilentConfigurationUpgradeService;

/**
* This class is responsible for properly creating install tool step actions
Expand Down Expand Up @@ -85,8 +87,45 @@ private function executeAction(StepInterface $action, $dryRun = false)
}
if ($needsExecution && !$dryRun) {
$messages = $action->execute();
$this->executeSilentConfigurationUpgradesIfNeeded();
$needsExecution = false;
}
return new InstallStepResponse($needsExecution, $messages);
}

/**
* Call silent upgrade class, redirect to self if configuration was changed.
*
* @throws RedirectException
* @return void
*/
private function executeSilentConfigurationUpgradesIfNeeded()
{
if (!file_exists(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class)->getLocalConfigurationFileLocation())) {
return;
}
$upgradeService = $this->objectManager->get(SilentConfigurationUpgradeService::class);
$count = 0;
do {
try {
$count++;
$upgradeService->execute();
$redirect = false;
} catch (RedirectException $e) {
$redirect = true;
$this->reloadConfiguration();
if ($count > 20) {
throw $e;
}
}
} while ($redirect === true);
}

/**
* Fetch the new configuration and expose it to the global array
*/
private function reloadConfiguration()
{
GeneralUtility::makeInstance(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class)->exportConfiguration();
}
}
2 changes: 1 addition & 1 deletion Classes/Mvc/Cli/CommandDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function executeCommand($command, array $arguments = [], array $environme
}
}

$process = $processBuilder->getProcess();
$process = $processBuilder->setTimeout(null)->getProcess();
$process->run();
$output = str_replace("\r\n", "\n", trim($process->getOutput()));

Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
"php": ">=5.5.0",
"helhum/typo3-console-plugin": "^1.5.0",

"typo3/cms-backend": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-core": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-extbase": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-extensionmanager": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-fluid": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-install": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-saltedpasswords": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-scheduler": "^7.6 || >=8.3.0 <8.7",
"typo3/cms-backend": "^7.6 || ^8.7",
"typo3/cms-core": "^7.6 || ^8.7",
"typo3/cms-extbase": "^7.6 || ^8.7",
"typo3/cms-extensionmanager": "^7.6 || ^8.7",
"typo3/cms-fluid": "^7.6 || ^8.7",
"typo3/cms-install": "^7.6 || ^8.7",
"typo3/cms-saltedpasswords": "^7.6 || ^8.7",
"typo3/cms-scheduler": "^7.6 || ^8.7",

"symfony/console": "^2.7 || ^3.0",
"symfony/process": "^2.7 || ^3.0"
},
"require-dev": {
"typo3-console/create-reference-command": "1.0.*@dev",
"typo3/cms": "^8.6",
"typo3/cms": "^8.7",
"nimut/testing-framework": "^1.0",
"mikey179/vfsStream": "~1.6.0",
"phpunit/phpunit": "~4.8.0"
Expand Down