[!!!][TASK] Rewrite install tool 68/21468/16
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Jun 2013 13:06:31 +0000 (15:06 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 19 Jun 2013 15:13:34 +0000 (17:13 +0200)
Main features:
* The god class "Installer" is gone and split into two major parts.
A step controller handling major upgrade and install tasks, and a
tool controller handling the known install tool actions.

* The step controller is designed to be always called prior to the
tool controller, if a step needs execution, it comes up, otherwise
the tool controller will be executed.

* The entry point typo3/install/index.php is gone and substituted
by typo3/sysext/install/Start/Install.php. The file contains a
lengthy comment to document the main request flow and used GET/POST
parameters.

* Most parts of the install tool do not bootstrap the whole system
anymore, in general only the base bootstrap, dbal (if loaded),
extbase and fluid ext_localconf.php are loaded. This makes sure
the install tool can not fatal if some extensions ext_localconf
is broken. The whole install tool runs without any caching, so a fatal
in some cache file can not kill the install tool execution.

* Installing TYPO3 CMS on a dbal enabled system is now handled in
the step installer directly to make the according code easier to
understand.

* Rendering is done with a simplified fluid standalone view.

* All install tool forms are CSRF protected.

* A new and fully unit tested class structure is introduced, designed
to take care of the basic file and folder structure of the instance.
It is used during installation to create the needed structure and
can be called in the install tool to compare and fix the current
instance structure with the expected structure. In effect, the
"dummy" package is obsolete. An instance can be created by just
linking index.php, typo3_src/ and typo3/ within the document root,
the installer takes care of creating everything else.

* The installation procedure is released from the package handling.
Packages will be handled by the extension manager after initial
installation with another patch.

Loose ends:
* The whole package handling needs to be implemented in the
extension manager.

* Not all upgrade wizards work, this code area needs some love.

* A 'core' auto updater could be implemented now. A GSoC project
is currently running to realize this.

* The SQL schema migration API is a mess and should be refactored.
For now, another helper class is introduced to encapsulate some
of the nasty details.

* An auto configuration and configuration suggestion system is
planned and needs to be done. It should suggest best configuration
options in the install tool, and should auto configure the system
during installation in the last install step.

* If the backend or frontend fatals due to some extension that
triggers a fatal in ext_localconf or ext_tables (for example
due to a require() of a no longer existing file), a small helper
action in the install tool could find those extensions and suggest
to unload them.

Change-Id: Ice3248caa903449ad6a83ea4f234c7bd125bdb66
Resolves: #49162
Releases: 6.2
Reviewed-on: https://review.typo3.org/21468
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Tested-by: Alexander Opitz
Reviewed-by: Stefan Froemken
Tested-by: Stefan Froemken
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
387 files changed:
index.php
typo3/init.php
typo3/install/README.txt [deleted file]
typo3/install/_.htaccess [deleted file]
typo3/install/index.php [changed mode: 0755->0644]
typo3/stylesheets/install/install.css [deleted file]
typo3/sysext/core/Classes/Compatibility/CompatbilityClassLoaderPhpBelow50307.php
typo3/sysext/core/Classes/Configuration/ConfigurationManager.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Database/SqlParser.php
typo3/sysext/core/Classes/FormProtection/InstallToolFormProtection.php
typo3/sysext/core/Classes/Utility/PhpOptionsUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/core/Configuration/FactoryConfiguration.php
typo3/sysext/core/Migrations/Code/LegacyClassesForIde.php
typo3/sysext/core/Resources/Private/Font/README.txt
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php
typo3/sysext/dbal/Classes/Autoloader.php [deleted file]
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php
typo3/sysext/dbal/Classes/ExtensionManager/MessageDisplay.php [deleted file]
typo3/sysext/dbal/Classes/Hooks/InstallToolHooks.php [deleted file]
typo3/sysext/dbal/Migrations/Code/ClassAliasMap.php
typo3/sysext/dbal/ext_localconf.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/install/Classes/CheckTheDatabaseHookInterface.php [deleted file]
typo3/sysext/install/Classes/Controller/AbstractController.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/AbstractAction.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/ActionInterface.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Common/InstallToolDisabledAction.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Common/InstallToolPasswordNotSetAction.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Common/LoginForm.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/CleanUp.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/FolderStructure.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/SystemEnvironment.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/TestSetup.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/UpdateWizard.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Action/Tool/Welcome.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/BackendModuleController.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/Exception.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/InstallToolModuleController.php [deleted file]
typo3/sysext/install/Classes/Controller/StepController.php [new file with mode: 0644]
typo3/sysext/install/Classes/Controller/ToolController.php [new file with mode: 0644]
typo3/sysext/install/Classes/CoreUpdates/ExtensionManagerTables.php
typo3/sysext/install/Classes/CoreUpdates/LocalConfigurationUpdate.php [deleted file]
typo3/sysext/install/Classes/Database/DatabaseConnectionMock.php [new file with mode: 0644]
typo3/sysext/install/Classes/EidHandler.php [deleted file]
typo3/sysext/install/Classes/EnableFileService.php [deleted file]
typo3/sysext/install/Classes/FolderStructure/AbstractNode.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/Exception.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/Exception/InvalidArgumentException.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/Exception/RootNodeException.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/FileNode.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/NodeInterface.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/RootNode.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/RootNodeInterface.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/StructureFacade.php [new file with mode: 0644]
typo3/sysext/install/Classes/FolderStructure/StructureFacadeInterface.php [new file with mode: 0644]
typo3/sysext/install/Classes/InstallBootstrap.php [deleted file]
typo3/sysext/install/Classes/Installer.php [deleted file]
typo3/sysext/install/Classes/Interfaces/CheckTheDatabaseHook.php [deleted file]
typo3/sysext/install/Classes/Report/InstallStatusReport.php
typo3/sysext/install/Classes/Service/BasicService.php [deleted file]
typo3/sysext/install/Classes/Service/EnableFileService.php [new file with mode: 0644]
typo3/sysext/install/Classes/Service/SessionService.php [new file with mode: 0644]
typo3/sysext/install/Classes/Service/SqlExpectedSchemaService.php [new file with mode: 0644]
typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php [new file with mode: 0644]
typo3/sysext/install/Classes/Service/UpdateDispatcherService.php [deleted file]
typo3/sysext/install/Classes/Session.php [deleted file]
typo3/sysext/install/Classes/Sql/SchemaMigrator.php [deleted file]
typo3/sysext/install/Classes/Status/StatusUtility.php
typo3/sysext/install/Classes/SystemEnvironment/Check.php
typo3/sysext/install/Classes/SystemEnvironment/TestImages/jesus.gif [deleted file]
typo3/sysext/install/Classes/SystemEnvironment/TestImages/jesus.png [deleted file]
typo3/sysext/install/Classes/Updates/Base.php [deleted file]
typo3/sysext/install/Classes/Updates/File/FilemountUpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Updates/File/InitUpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Updates/File/TceformsUpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Updates/File/TtContentUploadsUpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Updates/InitUpdateWizard.php
typo3/sysext/install/Classes/Updates/TceformsUpdateWizard.php
typo3/sysext/install/Classes/View/StandaloneView.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/Be/ContainerViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/ConstantViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/Exception.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/File/ImageDimensionViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/File/RelativePathViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/File/SizeViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/Format/CropViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Classes/ViewHelpers/Format/ImageMagickCommandsViewHelper.php [new file with mode: 0644]
typo3/sysext/install/Migrations/Code/ClassAliasMap.php
typo3/sysext/install/Resources/Private/Font/README.txt [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Font/vera.ttf [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Language/BackendModule.xlf [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Language/Report/locallang.xlf
typo3/sysext/install/Resources/Private/Layouts/BackendModule.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Layouts/Step.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Layouts/ToolAuthenticated.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/Copyright.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/Head.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/Headers.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/HiddenFormFields.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/Left.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/LoginForm.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/StatusMessage.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Common/SubmitButton.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/ConnectDetails.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/DbalDriverSelection.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/LoadDbal.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Step/DatabaseConnect/UnloadDbal.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/AllConfiguration/SubSection.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/CleanUp/ClearTables.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/CleanUp/ResetBackendUserUc.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/CleanUp/Typo3TempFiles.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/ChangeSiteName.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/CreateAdministrator.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/DatabaseAnalyzerButton.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/DatabaseAnalyzerData.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/DatabaseAnalyzerSuggestion.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/NewInstallToolPassword.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/SetNewEncryptionKey.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/ImportantActions/SystemInformation.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/AboutImageHandling.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/CombiningImages.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/ConvertImageFormatsToJpg.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/CurrentConfiguration.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/DisplayTwinImage.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/Gdlib.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/Mail.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/ScalingImages.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFontDpi.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/VerifyTestResults.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/WriteGifAndPng.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/GetUserInput.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/ListUpdates.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/UpdateWizard/PerformUpdate.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Common/InstallToolDisabled.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Common/InstallToolPasswordNotSet.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Common/Login.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseConnect.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseData.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DatabaseSelect.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/DefaultConfiguration.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Step/EnvironmentAndFolders.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/AllConfiguration.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/CleanUp.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/FolderStructure.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/ImportantActions.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/SystemEnvironment.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/TestSetup.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/UpdateWizard.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/Welcome.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/AlterPasswordForm.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/BackendModule/Index.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/BackendModule/ShowEnableInstallToolButton.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Templates/CheckImageMagick.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckMail.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckTheDatabaseAdminUser.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckTheDatabaseCache.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckTheDatabaseImport.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckTheDatabaseMenu.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CheckTheDatabaseUc.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/CleanUpManager.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/DisplayFieldComp.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/DisplayFields.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/DisplaySuggestions.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/DisplayTwinImage.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/GenerateConfigForm.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/GenerateUpdateDatabaseFormCheckboxes.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/GetUpdateDbFormWrap.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/ImageMenu.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/InitExtConfig.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Install.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Install_123.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Install_login.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/LoginForm.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Notice.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/PhpInformation.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/PrintAll.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/PrintSection.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/SetupGeneral.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/StepHeader.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/StepOutput.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Typo3ConfEdit.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Typo3TempManager.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/UpdateWizardParts.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/ViewArray.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/WriteToLocalConfControl.html [deleted file]
typo3/sysext/install/Resources/Public/Images/Background/Body.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/Button.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/ButtonHover.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/Content.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/ContentBottom.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/ContentTop.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/Logo.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Background/Menu.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/BackendModule.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/Error.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/Information.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/LoginIconKey.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/Notice.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/Ok.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Icon/Warning.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/AllConfiguration.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/CleanUp.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/FolderStructure.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/ImportantActions.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/Logout.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/SystemEnvironment.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/TestSetup.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/UpdateWizard.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/Menu/Welcome.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/BackgroundCombine.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/BackgroundGreen.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/MaskBlackWhite.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/MaskCombine.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.ai [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.bmp [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.pcx [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.pdf [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.tga [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Test.tif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Transparent.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestInput/Transparent.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/About.txt [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Combine-1.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Combine-2.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Font.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-box.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-box.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-niceText.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-niceText.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-shadow.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-shadow.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-simple.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-simple.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-text.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Gdlib-text.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-ai.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-bmp.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-gif.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-jpg.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-pcx.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-pdf.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-png.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-tga.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Read-tif.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Scale-gif.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Scale-jpg.jpg [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Scale-png.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Write-gif.gif [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/TestReference/Write-png.png [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Images/body-background.jpg [deleted file]
typo3/sysext/install/Resources/Public/Images/button-background-hover.jpg [deleted file]
typo3/sysext/install/Resources/Public/Images/button-background.jpg [deleted file]
typo3/sysext/install/Resources/Public/Images/content-background.jpg [deleted file]
typo3/sysext/install/Resources/Public/Images/content-bottom.png [deleted file]
typo3/sysext/install/Resources/Public/Images/content-top.png [deleted file]
typo3/sysext/install/Resources/Public/Images/input-background.gif [deleted file]
typo3/sysext/install/Resources/Public/Images/login-icon-key.gif [deleted file]
typo3/sysext/install/Resources/Public/Images/logo.gif [deleted file]
typo3/sysext/install/Resources/Public/Images/menuAbout.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuBackground.gif [deleted file]
typo3/sysext/install/Resources/Public/Images/menuCleanup.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuConfig.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuDatabase.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuExtConfig.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuImages.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuPhpinfo.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuSystemEnvironment.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuTypo3confEdit.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuTypo3temp.png [deleted file]
typo3/sysext/install/Resources/Public/Images/menuUpdate.png [deleted file]
typo3/sysext/install/Resources/Public/Images/numbers.png [deleted file]
typo3/sysext/install/Resources/Public/Javascript/Install.js [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Javascript/install.js [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/EarlyExit.css [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/Install.css [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Common/Login.css [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/Action/Step/General.css [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/BackendModule/ShowEnableInstallToolButton.css [new file with mode: 0644]
typo3/sysext/install/Resources/Public/Stylesheets/general.css [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/ie7.css [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/install.css [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/install_123.css [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/install_login.css [deleted file]
typo3/sysext/install/Resources/Public/Stylesheets/reset.css [deleted file]
typo3/sysext/install/Start/Install.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/AbstractNodeTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/DefaultFactoryTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/FileNodeTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/RootNodeTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/FolderStructure/StructureFacadeTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/InstallToolTest.php [deleted file]
typo3/sysext/install/Tests/Unit/SchemaMigratorTest.php [deleted file]
typo3/sysext/install/Tests/Unit/Service/SqlSchemaMigrationServiceTest.php [new file with mode: 0644]
typo3/sysext/install/Tests/Unit/Status/StatusUtilityTest.php
typo3/sysext/install/ext_autoload.php [deleted file]
typo3/sysext/install/ext_icon.gif [changed mode: 0755->0644]
typo3/sysext/install/ext_localconf.php
typo3/sysext/install/ext_tables.php
typo3/sysext/install/imgs/blackwhite_mask.gif [deleted file]
typo3/sysext/install/imgs/combine_back.jpg [deleted file]
typo3/sysext/install/imgs/combine_mask.jpg [deleted file]
typo3/sysext/install/imgs/copyrights.txt [deleted file]
typo3/sysext/install/imgs/greenback.gif [deleted file]
typo3/sysext/install/imgs/jesus.bmp [deleted file]
typo3/sysext/install/imgs/jesus.gif [deleted file]
typo3/sysext/install/imgs/jesus.jpg [deleted file]
typo3/sysext/install/imgs/jesus.pcx [deleted file]
typo3/sysext/install/imgs/jesus.png [deleted file]
typo3/sysext/install/imgs/jesus.tga [deleted file]
typo3/sysext/install/imgs/jesus.tif [deleted file]
typo3/sysext/install/imgs/jesus2_transp.gif [deleted file]
typo3/sysext/install/imgs/jesus2_transp.png [deleted file]
typo3/sysext/install/imgs/pdf_from_imagemagick.pdf [deleted file]
typo3/sysext/install/imgs/typo3logotype.ai [deleted file]
typo3/sysext/install/mod/class.tx_install.php [deleted file]
typo3/sysext/install/mod/class.tx_install_ajax.php [deleted file]
typo3/sysext/install/mod/class.tx_install_session.php [deleted file]
typo3/sysext/install/mod/clear.gif [deleted file]
typo3/sysext/install/mod/conf.php [deleted file]
typo3/sysext/install/mod/index.php [deleted file]
typo3/sysext/install/mod/install.gif [deleted file]
typo3/sysext/install/mod/locallang_mod.xlf [deleted file]
typo3/sysext/install/mod/mod_styles.css [deleted file]
typo3/sysext/install/mod/mod_template.html [deleted file]
typo3/sysext/install/report/class.tx_install_report_installstatus.php [deleted file]
typo3/sysext/install/report/locallang.xlf [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_addflexformstoacl.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_charsetdefaults.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_compatversion.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_compressionlevel.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_cscsplit.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_flagsfromsprite.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_imagelink.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_imagescols.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_localconfiguration.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_mediaflexform.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_mergeadvanced.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_migrateworkspaces.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_notinmenu.php [deleted file]
typo3/sysext/install/updates/class.tx_coreupdates_t3skin.php [deleted file]
typo3/sysext/install/verify_imgs/install_44f1273ab1.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_48784f637a.gif [deleted file]
typo3/sysext/install/verify_imgs/install_48784f637a.png [deleted file]
typo3/sysext/install/verify_imgs/install_a8f7a333c8.gif [deleted file]
typo3/sysext/install/verify_imgs/install_a8f7a333c8.png [deleted file]
typo3/sysext/install/verify_imgs/install_d1fa76faad.gif [deleted file]
typo3/sysext/install/verify_imgs/install_d1fa76faad.png [deleted file]
typo3/sysext/install/verify_imgs/install_f6b0cedc4d.gif [deleted file]
typo3/sysext/install/verify_imgs/install_f6b0cedc4d.png [deleted file]
typo3/sysext/install/verify_imgs/install_fcaf26c521.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_fe1e67e805.gif [deleted file]
typo3/sysext/install/verify_imgs/install_fe1e67e805.png [deleted file]
typo3/sysext/install/verify_imgs/install_read_ai.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_bmp.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_gif.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_jpg.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_pcx.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_pdf.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_png.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_tga.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_read_tif.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_scale_gif.gif [deleted file]
typo3/sysext/install/verify_imgs/install_scale_jpg.jpg [deleted file]
typo3/sysext/install/verify_imgs/install_scale_png.png [deleted file]
typo3/sysext/install/verify_imgs/install_write_gif.gif [deleted file]
typo3/sysext/install/verify_imgs/install_write_png.png [deleted file]
typo3/sysext/install/verify_imgs/readme.txt [deleted file]

index 74cdf99..43d98a7 100644 (file)
--- a/index.php
+++ b/index.php
@@ -36,7 +36,7 @@
 require 'typo3/sysext/core/Classes/Core/Bootstrap.php';
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->baseSetup('')
-       ->redirectToInstallToolIfLocalConfigurationFileDoesNotExist();
+       ->redirectToInstallerIfLocalConfigurationFileDoesNotExist();
 
 require(PATH_tslib . 'index_ts.php');
 ?>
\ No newline at end of file
index f67017a..70dcd94 100644 (file)
@@ -56,7 +56,7 @@ require 'sysext/core/Classes/Core/Bootstrap.php';
 
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->baseSetup('typo3/')
-       ->redirectToInstallToolIfLocalConfigurationFileDoesNotExist('../')
+       ->redirectToInstallerIfLocalConfigurationFileDoesNotExist('../')
        ->startOutputBuffering()
        ->loadConfigurationAndInitialize()
        ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
diff --git a/typo3/install/README.txt b/typo3/install/README.txt
deleted file mode 100755 (executable)
index 6a93259..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-typo3/install/
-
-Trigger script for the install tool.
-You can access the install tool from ".../typo3/install/"
-Notice: The "install" extension has to be loaded.
\ No newline at end of file
diff --git a/typo3/install/_.htaccess b/typo3/install/_.htaccess
deleted file mode 100755 (executable)
index 77d1492..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-AuthType Basic
-AuthName Typo3InstallScript
-AuthUserFile /www/.htpasswd
-require valid-user
old mode 100755 (executable)
new mode 100644 (file)
index 31e5320..3bebebc
@@ -1,61 +1,7 @@
 <?php
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Starter-script for install screen
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-define('TYPO3_MODE', 'BE');
-define('TYPO3_enterInstallScript', '1');
-
-require '../sysext/core/Classes/Core/Bootstrap.php';
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->baseSetup('typo3/install/');
-
-require '../sysext/install/Classes/InstallBootstrap.php';
-\TYPO3\CMS\Install\InstallBootstrap::checkEnabledInstallToolOrDie();
-\TYPO3\CMS\Install\InstallBootstrap::createLocalConfigurationIfNotExists();
-
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->startOutputBuffering()
-       ->loadConfigurationAndInitialize()
-       ->loadTypo3LoadedExtAndExtLocalconf(FALSE)
-       ->applyAdditionalConfigurationSettings()
-       ->initializeTypo3DbGlobal()
-       ->checkLockedBackendAndRedirectOrDie()
-       ->checkBackendIpOrDie()
-       ->checkSslBackendAndRedirectIfNeeded();
-
-       // Run install script
-if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('install')) {
-       die('Install Tool is not loaded as an extension.<br />You must add the key "install" to the list of installed extensions in typo3conf/LocalConfiguration.php, $TYPO3_CONF_VARS[\'EXT\'][\'extListArray\'].');
-}
-require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('install') . 'mod/class.tx_install.php';
-$install_check = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Installer', TRUE);
-$install_check->init();
+// Legacy file. The old install tool entry point was here, it is kept as well known
+// resource for backward compatibility and just redirects to the new entry point.
+header('HTTP/1.1 303 See Other');
+header('Location: ../sysext/install/Start/Install.php');
+die;
 ?>
\ No newline at end of file
diff --git a/typo3/stylesheets/install/install.css b/typo3/stylesheets/install/install.css
deleted file mode 100644 (file)
index a2d5cdb..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-@charset "UTF-8";
-
-/* Font size 62.8% = 1em = 10px */
-body {
-       font: 62.8% Verdana, Arial, Helvetica, sans-serif;
-       background-color: #f2f2f2;
-       padding-top: 11em;
-}
-
-body.standalone {
-       background: #4f4f4f url('../../gfx/installbackground.jpg') repeat-x fixed;
-}
-
-h1 {
-       display: none;
-}
-
-.standalone h1 {
-       background: url('../../sysext/t3skin/images/login/typo3logo-white-greyback.gif') no-repeat scroll 0 0 transparent;
-       text-indent: -999em;
-       display: block;
-       height: 34px;
-       margin: 0 0 1.85em;
-}
-
-h2 {
-       margin-top: 0;
-}
-
-#container {
-       margin: 0 auto;
-       width: 41em;
-       font-size: 110%;
-       line-height: 1.7em;
-}
-
-.typo3-message {
-       background-position: 1.2em 1.8em;
-       background-repeat: no-repeat;
-       border: 1px solid;
-       color: #9e7d4a;
-       padding: 1.5em 1.5em 1em 3.5em;
-}
-
-.message-warning {
-       background-image: url("../../gfx/warning.png");
-       background-color: #fbf6de;
-       border-color: #b1905c;
-}
-
-.typo3-message ul {
-       padding-left: 20px;
-}
-
-.typo3-message a {
-       color: #9e7d4a;
-}
-
-.typo3-message a:hover {
-       color: #000000;
-}
-
-.standalone .t3-install-locked-user-settings {
-       display: none;
-}
index bdf3919..f13eff1 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace TYPO3\CMS\Core\Compatibility;
-use \TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /***************************************************************
  *  Copyright notice
@@ -28,6 +27,8 @@ use \TYPO3\CMS\Core\Utility\GeneralUtility;
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
 
+use \TYPO3\CMS\Core\Utility\GeneralUtility;
+
 /**
  * This is a compatibility layer for systems running PHP < 5.3.7
  * It rewrites the type hints in method definitions so that they are identical to the
@@ -83,6 +84,10 @@ class CompatbilityClassLoaderPhpBelow50307 extends \TYPO3\CMS\Core\Core\ClassLoa
                ) {
                        // If class in question starts with one of the allowed old prefixes
                        static::checkClassCacheEntryAndRequire($classPath);
+                       // Load original file if the class is still not there (because cache is disabled)
+                       if (!class_exists($className)) {
+                               static::requireClassFile($classPath);
+                       }
                } else {
                        // Do nothing for system extensions or external libraries.
                        // They are already using the proper type hints or do not use them at all.
index 769f9e5..96067e6 100644 (file)
@@ -64,11 +64,6 @@ class ConfigurationManager {
        protected $additionalFactoryConfigurationFile = 'typo3conf/AdditionalFactoryConfiguration.php';
 
        /**
-        * @var string Path to legacy localconf.php file, relative to PATH_site
-        */
-       protected $localconfFile = 'typo3conf/localconf.php';
-
-       /**
         * @var string Absolute path to typo3conf directory
         */
        protected $pathTypo3Conf = PATH_typo3conf;
@@ -156,16 +151,6 @@ class ConfigurationManager {
        }
 
        /**
-        * Get the file resource
-        *
-        * @return string
-        * @deprecated since 6.1, will be removed if the compatibily layer for localconf.php is dropped
-        */
-       public function getLocalconfFileLocation() {
-               return PATH_site . $this->localconfFile;
-       }
-
-       /**
         * Override local configuration with new values.
         *
         * @param array $configurationToMerge Override configuration array
@@ -265,12 +250,6 @@ class ConfigurationManager {
                ) {
                        $result = FALSE;
                }
-               if (
-                       file_exists($this->getLocalconfFileLocation())
-                       && !@is_writable($this->getLocalconfFileLocation())
-               ) {
-                       $result = FALSE;
-               }
                return $result;
        }
 
@@ -278,7 +257,6 @@ class ConfigurationManager {
         * Reads the configuration array and exports it to the global variable
         *
         * @access private
-        * @throws \RuntimeException
         * @throws \UnexpectedValueException
         * @return void
         */
@@ -293,36 +271,9 @@ class ConfigurationManager {
                        if (@is_file($this->getAdditionalConfigurationFileLocation())) {
                                require $this->getAdditionalConfigurationFileLocation();
                        }
-                       // @deprecated since 6.0: Simulate old 'extList' as comma separated list of 'extListArray'
-                       $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = implode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray']);
-               } elseif (@is_file($this->getLocalconfFileLocation())) {
-                       $GLOBALS['TYPO3_CONF_VARS'] = $this->getDefaultConfiguration();
-                       // Legacy localconf.php handling
-                       // @deprecated: Can be removed if old localconf.php is not supported anymore
-                       global $TYPO3_CONF_VARS, $typo_db, $typo_db_username, $typo_db_password, $typo_db_host, $typo_db_extTableDef_script;
-                       require $this->getLocalconfFileLocation();
-                       // If the localconf.php was not upgraded to LocalConfiguration.php, the default extListArray
-                       // from EXT:core/Configuration/DefaultConfiguration.php is still set. In this case we just unset
-                       // this key here, so \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray() falls back to use extList string
-                       // @deprecated: This case can be removed later if localconf.php is not supported anymore
-                       unset($TYPO3_CONF_VARS['EXT']['extListArray']);
-                       // Write the old globals into the new place in the configuration array
-                       $GLOBALS['TYPO3_CONF_VARS']['DB'] = array();
-                       $GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = $typo_db;
-                       $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = $typo_db_username;
-                       $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = $typo_db_password;
-                       $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = $typo_db_host;
-                       $GLOBALS['TYPO3_CONF_VARS']['DB']['extTablesDefinitionScript'] = $typo_db_extTableDef_script;
-                       unset($GLOBALS['typo_db']);
-                       unset($GLOBALS['typo_db_username']);
-                       unset($GLOBALS['typo_db_password']);
-                       unset($GLOBALS['typo_db_host']);
-                       unset($GLOBALS['typo_db_extTableDef_script']);
                } else {
-                       throw new \RuntimeException(
-                               'Neither ' . $this->localConfigurationFile . ' (recommended) nor ' . $this->localconfFile . ' (obsolete) could be found!',
-                               1349272337
-                       );
+                       // No LocalConfiguration (yet), load DefaultConfiguration only
+                       $GLOBALS['TYPO3_CONF_VARS'] = $this->getDefaultConfiguration();
                }
        }
 
@@ -379,13 +330,15 @@ class ConfigurationManager {
         * file in typo3conf to create a basic LocalConfiguration.php. This is used
         * by the install tool in an early step.
         *
+        * @throws \RuntimeException
         * @return void
         * @access private
         */
        public function createLocalConfigurationFromFactoryConfiguration() {
                if (file_exists($this->getLocalConfigurationFileLocation())) {
                        throw new \RuntimeException(
-                               'LocalConfiguration.php exists already', 1364836026
+                               'LocalConfiguration.php exists already',
+                               1364836026
                        );
                }
                $localConfigurationArray = require $this->getFactoryConfigurationFileLocation();
index 7d59ce5..b93df02 100644 (file)
@@ -123,21 +123,18 @@ class Bootstrap {
        }
 
        /**
-        * Redirect to install tool if LocalConfiguration.php is missing
+        * Redirect to install tool if LocalConfiguration.php is missing.
         *
         * @param string $pathUpToDocumentRoot Can contain eg. '../' if called from a sub directory
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         * @internal This is not a public API method, do not use in own extensions
         */
-       public function redirectToInstallToolIfLocalConfigurationFileDoesNotExist($pathUpToDocumentRoot = '') {
+       public function redirectToInstallerIfLocalConfigurationFileDoesNotExist($pathUpToDocumentRoot = '') {
                /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
                $configurationManager = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
-               if (
-                       !file_exists($configurationManager->getLocalConfigurationFileLocation())
-                       && !file_exists($configurationManager->getLocalconfFileLocation())
-               ) {
+               if (!file_exists($configurationManager->getLocalConfigurationFileLocation())) {
                        require_once __DIR__ . '/../Utility/HttpUtility.php';
-                       Utility\HttpUtility::redirect($pathUpToDocumentRoot . 'typo3/install/index.php?mode=123&step=1&password=joh316');
+                       Utility\HttpUtility::redirect($pathUpToDocumentRoot . 'typo3/sysext/install/Start/Install.php');
                }
                return $this;
        }
@@ -146,12 +143,21 @@ class Bootstrap {
         * Includes LocalConfiguration.php and sets several
         * global settings depending on configuration.
         *
+        * @param boolean $allowCaching Whether to allow caching - affects cache_core (autoloader)
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         * @internal This is not a public API method, do not use in own extensions
         */
-       public function loadConfigurationAndInitialize() {
-               $this->getInstance()
-                       ->populateLocalConfiguration()
+       public function loadConfigurationAndInitialize($allowCaching = TRUE) {
+               $bootstrap = $this->getInstance();
+
+               $bootstrap->populateLocalConfiguration();
+
+               if (!$allowCaching) {
+                       $bootstrap->setCoreCacheToNullBackend();
+               }
+
+               $bootstrap->defineDatabaseConstants()
+                       ->defineUserAgentConstant()
                        ->registerExtDirectComponents()
                        ->initializeCachingFramework()
                        ->registerAutoloader()
@@ -190,7 +196,6 @@ class Bootstrap {
        /**
         * Load TYPO3_LOADED_EXT, recreate class loader registry and load ext_localconf
         *
-        * @param boolean $allowCaching
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         * @internal This is not a public API method, do not use in own extensions
         */
@@ -239,14 +244,33 @@ class Bootstrap {
         * execute typo3conf/AdditionalConfiguration.php, define database related constants.
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function populateLocalConfiguration() {
-               try {
-                       Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')
-                               ->exportConfiguration();
-               } catch (\Exception $e) {
-                       die($e->getMessage());
-               }
+       public function populateLocalConfiguration() {
+               /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
+               $configurationManager = Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+               $configurationManager->exportConfiguration();
+               return $this;
+       }
+
+       /**
+        * Set cache_core to null backend, effectively disabling eg. the autoloader cache
+        *
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
+        */
+       public function setCoreCacheToNullBackend() {
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_core']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               return $this;
+       }
+
+       /**
+        * Define database constants
+        *
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        */
+       protected function defineDatabaseConstants() {
                define('TYPO3_db', $GLOBALS['TYPO3_CONF_VARS']['DB']['database']);
                define('TYPO3_db_username', $GLOBALS['TYPO3_CONF_VARS']['DB']['username']);
                define('TYPO3_db_password', $GLOBALS['TYPO3_CONF_VARS']['DB']['password']);
@@ -255,6 +279,15 @@ class Bootstrap {
                        isset($GLOBALS['TYPO3_CONF_VARS']['DB']['extTablesDefinitionScript'])
                        ? $GLOBALS['TYPO3_CONF_VARS']['DB']['extTablesDefinitionScript']
                        : 'extTables.php');
+               return $this;
+       }
+
+       /**
+        * Define user agent constant
+        *
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        */
+       protected function defineUserAgentConstant() {
                define('TYPO3_user_agent', 'User-Agent: ' . $GLOBALS['TYPO3_CONF_VARS']['HTTP']['userAgent']);
                return $this;
        }
index 8fe943d..b93d26f 100644 (file)
@@ -181,15 +181,9 @@ class SystemEnvironmentBuilder {
                if (!is_file(PATH_thisScript)) {
                        die('Unable to determine path to entry script.');
                }
-               if (!is_dir(PATH_t3lib)) {
-                       die('Calculated absolute path to t3lib directory does not exist.');
-               }
                if (!is_dir(PATH_tslib)) {
                        die('Calculated absolute path to tslib directory does not exist.');
                }
-               if (!is_dir(PATH_typo3conf)) {
-                       die('Calculated absolute path to typo3conf directory does not exist');
-               }
        }
 
        /**
index ef8a3c3..31a6650 100644 (file)
@@ -1183,7 +1183,7 @@ class DatabaseConnection {
                        $this->databaseUsername,
                        $this->databaseUserPassword,
                        NULL,
-                       $this->databasePort,
+                       (int)$this->databasePort,
                        NULL,
                        $this->connectionCompression ? MYSQLI_CLIENT_COMPRESS : 0
                );
index f66b694..e5960f9 100644 (file)
@@ -26,11 +26,7 @@ namespace TYPO3\CMS\Core\Database;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-/**
- * TYPO3 SQL parser
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
+
 /**
  * TYPO3 SQL parser class.
  *
index 0debe8c..9d254e4 100644 (file)
@@ -90,10 +90,12 @@ class InstallToolFormProtection extends AbstractFormProtection {
         *
         * This instance will be used for displaying messages.
         *
-        * @param \TYPO3\CMS\Install\Installer $installTool the current instance of the install tool
+        * @param object $installTool The current instance of the install tool
         * @return void
+        * @deprecated since 6.2, will be removed two versions later. Message handling is done by install tool
         */
-       public function injectInstallTool(\TYPO3\CMS\Install\Installer $installTool) {
+       public function injectInstallTool($installTool) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
                $this->installTool = $installTool;
        }
 
@@ -102,9 +104,16 @@ class InstallToolFormProtection extends AbstractFormProtection {
         * form token is invalid.
         *
         * @return void
+        * @deprecated since 6.2, will be removed two versions later. Message handling is done by install tool
         */
        protected function createValidationErrorMessage() {
-               $this->installTool->addErrorMessage('Validating the security token of this form has failed. ' . 'Please reload the form and submit it again.');
+               // @deprecated since 6.2, neither the install tool class nor the addErrorMessage() exist anymore
+               if (is_object($this->installTool)) {
+                       $this->installTool->addErrorMessage(
+                               'Validating the security token of this form has failed. '
+                               . 'Please reload the form and submit it again.'
+                       );
+               }
        }
 
        /**
index b48519d..45c17ff 100644 (file)
@@ -65,8 +65,10 @@ class PhpOptionsUtility {
         * Check if php sql.safe_mode is enabled
         *
         * @return boolean TRUE if sql.safe_mode is enabled, FALSE if disabled
+        * @deprecated since 6.2, will be removed two versions later
         */
        static public function isSqlSafeModeEnabled() {
+               GeneralUtility::logDeprecatedFunction();
                return self::getIniValueBoolean('sql.safe_mode');
        }
 
index 83cc43b..172a228 100644 (file)
@@ -210,7 +210,8 @@ return array(
                                'Image.Preview' => 'TYPO3\\CMS\\Core\\Resource\\Processing\\ImagePreviewTask',
                                'Image.CropScaleMask' => 'TYPO3\\CMS\\Core\\Resource\\Processing\\ImageCropScaleMaskTask'
                        )
-               )
+               ),
+               'isInitialInstallationInProgress' => FALSE,             // Boolean: If TRUE, the installation is 'in progress'. This value is handled within the install tool step installer internally.
        ),
        'EXT' => array( // Options related to the Extension Management
                'allowGlobalInstall' => FALSE,          // Boolean: If set, global extensions in typo3/ext/ are allowed to be installed, updated and deleted etc.
index 3b608e6..7dd34f6 100644 (file)
@@ -7,6 +7,10 @@
  */
 return array(
        'BE' => array(
+               'explicitADmode' => 'explicitAllow',
+               'fileCreateMask' => '0664',
+               'folderCreateMask' => '2774',
+               'forceCharset' => 'utf-8',
                'installToolPassword' => 'bacb98acf97e0b6112b1d1b650b84971',
        ),
        'DB' => array(
@@ -50,7 +54,13 @@ return array(
                        'form',
                ),
        ),
+       'GFX' => array(
+               'jpg_quality' => '80',
+       ),
        'SYS' => array(
+               'compat_version' => '6.2',
+               'isInitialInstallationInProgress' => TRUE,
+               'setDBinit' => 'SET NAMES utf8;',
                'sitename' => 'New TYPO3 site',
        ),
 );
index 8cf220f..8b61d75 100644 (file)
@@ -1464,26 +1464,11 @@ class ux_t3lib_sqlparser extends \TYPO3\CMS\Dbal\Database\SqlParser {}
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class tx_dbal_autoloader extends \TYPO3\CMS\Dbal\Autoloader {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class tx_dbal_module1 extends \TYPO3\CMS\Dbal\Controller\ModuleController {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class tx_dbal_tsparserext extends \TYPO3\CMS\Dbal\ExtensionManager\MessageDisplay {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
-class tx_dbal_installtool extends \TYPO3\CMS\Dbal\Hooks\InstallToolHooks {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class tx_dbal_querycache extends \TYPO3\CMS\Dbal\QueryCache {}
 
 /**
@@ -5409,16 +5394,6 @@ class tx_infopagetsconfig_webinfo extends \TYPO3\CMS\InfoPagetsconfig\Controller
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-interface Tx_Install_Interfaces_CheckTheDatabaseHook extends \TYPO3\CMS\Install\CheckTheDatabaseHookInterface {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
-class tx_install_mod1 extends \TYPO3\CMS\Install\Controller\InstallToolModuleController {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
 class tx_coreupdates_addflexformstoacl extends \TYPO3\CMS\Install\CoreUpdates\AddFlexFormsToAclUpdate {}
 
 /**
@@ -5489,17 +5464,7 @@ class tx_coreupdates_t3skin extends \TYPO3\CMS\Install\CoreUpdates\T3skinUpdate
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class tx_install_ajax extends \TYPO3\CMS\Install\EidHandler {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
-class Tx_Install_Service_BasicService extends \TYPO3\CMS\Install\EnableFileService {}
-
-/**
- * @deprecated since 6.0 will be removed in 7.0
- */
-class tx_install extends \TYPO3\CMS\Install\Installer {}
+class Tx_Install_Service_BasicService extends \TYPO3\CMS\Install\Service\EnableFileService {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
@@ -5509,12 +5474,12 @@ class tx_install_report_InstallStatus extends \TYPO3\CMS\Install\Report\InstallS
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class tx_install_session extends \TYPO3\CMS\Install\Session {}
+class tx_install_session extends \TYPO3\CMS\Install\Service\SessionService {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
  */
-class t3lib_install_Sql extends \TYPO3\CMS\Install\Sql\SchemaMigrator {}
+class t3lib_install_Sql extends \TYPO3\CMS\Install\Service\SqlSchemaMigrationService {}
 
 /**
  * @deprecated since 6.0 will be removed in 7.0
index b4f1e87..3040ff2 100644 (file)
@@ -1,5 +1,3 @@
-Fonts:
-
 *******************************************************************************
 Nimbus Sans L regular
 "nimbus.ttf" - An "arial"-look-alike font. If you want to use the real Arial
@@ -7,7 +5,7 @@ font you should upload the arial-normal ttf file from your Windows system
 (fonts/arial.ttf).
 *******************************************************************************
 
-License (t3lib/fonts/nimbus.ttf):
+License (nimbus.ttf):
 
 nimbus.ttf was downloaded as n019003l.ttf from
 <ftp://ftp.gnome.ru/fonts/urw/release/urw-fonts-1.0.7pre18-ttf.tar.bz2>.
@@ -30,144 +28,4 @@ nimbus.sfd.gz was downladed as NimbusSansL-Regu.sfd from
        You should have received a copy of the GNU General Public License
        along with this program; if not, write to the Free Software
        Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-       02110-1301, USA.
-
-
-
-*******************************************************************************
-Bitstream Vera Sans
-"vera.ttf" - A "verdana"-look-alike font. If you want to use the real Verdana
-font you should upload the verdana-normal ttf file from your Windows system
-(fonts/verdana.ttf).
-*******************************************************************************
-
-This file was downloaded from <http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/>.
-
-Copyright Holder: Bitstream, Inc.
-
-License (t3lib/fonts/vera.ttf):
-
-Bitstream Vera Fonts Copyright
-
-The fonts have a generous copyright, allowing derivative works (as
-long as "Bitstream" or "Vera" are not in the names), and full
-redistribution (so long as they are not *sold* by themselves). They
-can be be bundled, redistributed and sold with any software.
-
-The fonts are distributed under the following copyright:
-
-Copyright
-=========
-
-Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
-Vera is a trademark of Bitstream, Inc.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the fonts accompanying this license ("Fonts") and associated
-documentation files (the "Font Software"), to reproduce and distribute
-the Font Software, including without limitation the rights to use,
-copy, merge, publish, distribute, and/or sell copies of the Font
-Software, and to permit persons to whom the Font Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright and trademark notices and this permission notice
-shall be included in all copies of one or more of the Font Software
-typefaces.
-
-The Font Software may be modified, altered, or added to, and in
-particular the designs of glyphs or characters in the Fonts may be
-modified and additional glyphs or characters may be added to the
-Fonts, only if the fonts are renamed to names not containing either
-the words "Bitstream" or the word "Vera".
-
-This License becomes null and void to the extent applicable to Fonts
-or Font Software that has been modified and is distributed under the
-"Bitstream Vera" names.
-
-The Font Software may be sold as part of a larger software package but
-no copy of one or more of the Font Software typefaces may be sold by
-itself.
-
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
-BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
-OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
-SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
-
-Except as contained in this notice, the names of Gnome, the Gnome
-Foundation, and Bitstream Inc., shall not be used in advertising or
-otherwise to promote the sale, use or other dealings in this Font
-Software without prior written authorization from the Gnome Foundation
-or Bitstream Inc., respectively. For further information, contact:
-fonts at gnome dot org.
-
-Copyright FAQ
-=============
-
-   1. I don't understand the resale restriction... What gives?
-
-      Bitstream is giving away these fonts, but wishes to ensure its
-      competitors can't just drop the fonts as is into a font sale system
-      and sell them as is. It seems fair that if Bitstream can't make money
-      from the Bitstream Vera fonts, their competitors should not be able to
-      do so either. You can sell the fonts as part of any software package,
-      however.
-
-   2. I want to package these fonts separately for distribution and
-      sale as part of a larger software package or system.  Can I do so?
-
-      Yes. A RPM or Debian package is a "larger software package" to begin
-      with, and you aren't selling them independently by themselves.
-      See 1. above.
-
-   3. Are derivative works allowed?
-      Yes!
-
-   4. Can I change or add to the font(s)?
-      Yes, but you must change the name(s) of the font(s).
-
-   5. Under what terms are derivative works allowed?
-
-      You must change the name(s) of the fonts. This is to ensure the
-      quality of the fonts, both to protect Bitstream and Gnome. We want to
-      ensure that if an application has opened a font specifically of these
-      names, it gets what it expects (though of course, using fontconfig,
-      substitutions could still could have occurred during font
-      opening). You must include the Bitstream copyright. Additional
-      copyrights can be added, as per copyright law. Happy Font Hacking!
-
-   6. If I have improvements for Bitstream Vera, is it possible they might get
-       adopted in future versions?
-
-      Yes. The contract between the Gnome Foundation and Bitstream has
-      provisions for working with Bitstream to ensure quality additions to
-      the Bitstream Vera font family. Please contact us if you have such
-      additions. Note, that in general, we will want such additions for the
-      entire family, not just a single font, and that you'll have to keep
-      both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
-      glyphs to the font, they must be stylistically in keeping with Vera's
-      design. Vera cannot become a "ransom note" font. Jim Lyles will be
-      providing a document describing the design elements used in Vera, as a
-      guide and aid for people interested in contributing to Vera.
-
-   7. I want to sell a software package that uses these fonts: Can I do so?
-
-      Sure. Bundle the fonts with your software and sell your software
-      with the fonts. That is the intent of the copyright.
-
-   8. If applications have built the names "Bitstream Vera" into them,
-      can I override this somehow to use fonts of my choosing?
-
-      This depends on exact details of the software. Most open source
-      systems and software (e.g., Gnome, KDE, etc.) are now converting to
-      use fontconfig (see www.fontconfig.org) to handle font configuration,
-      selection and substitution; it has provisions for overriding font
-      names and subsituting alternatives. An example is provided by the
-      supplied local.conf file, which chooses the family Bitstream Vera for
-      "sans", "serif" and "monospace".  Other software (e.g., the XFree86
-      core server) has other mechanisms for font substitution.
-
+       02110-1301, USA.
\ No newline at end of file
index e2ce155..4257ff0 100644 (file)
@@ -350,34 +350,6 @@ class ConfigurationManagerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
-       public function canWriteConfigurationReturnsFalseIfLocalconfFileIsNotWritable() {
-               if (function_exists('posix_getegid') && posix_getegid() === 0) {
-                       $this->markTestSkipped('Test skipped if run on linux as root');
-               } elseif (TYPO3_OS == 'WIN') {
-                       $this->markTestSkipped('Not available on Windows');
-               }
-               /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $fixture = $this->getAccessibleMock('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager', array('dummy'));
-
-               $file = 'typo3temp/' . uniqid('test_');
-               $absoluteFile = PATH_site . $file;
-               touch($absoluteFile);
-               $this->testFilesToDelete[] = $absoluteFile;
-               chmod($absoluteFile, 0444);
-               clearstatcache();
-
-               $fixture->_set('localconfFile', $file);
-
-               $result = $fixture->canWriteConfiguration();
-
-               chmod($absoluteFile, 0644);
-
-               $this->assertFalse($result);
-       }
-
-       /**
-        * @test
-        */
        public function canWriteConfigurationReturnsTrueIfDirectoryAndFilesAreWritable() {
                /** @var $fixture \TYPO3\CMS\Core\Configuration\ConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
                $fixture = $this->getAccessibleMock('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager', array('dummy'));
index fe9cfea..78e9cdb 100644 (file)
@@ -108,10 +108,11 @@ class InstallToolFormProtectionTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 
        /**
         * @test
+        * @deprecated since 6.2. Test can be removed if injectInstallTool method is dropped
         */
        public function createValidationErrorMessageAddsErrorMessage() {
                $installTool = $this->getMock(
-                       'TYPO3\\CMS\\Install\\Installer', array('addErrorMessage'), array(), '', FALSE
+                       'stdClass', array('addErrorMessage'), array(), '', FALSE
                );
                $installTool->expects($this->once())->method('addErrorMessage')
                        ->with(
diff --git a/typo3/sysext/dbal/Classes/Autoloader.php b/typo3/sysext/dbal/Classes/Autoloader.php
deleted file mode 100644 (file)
index 170a894..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-namespace TYPO3\CMS\Dbal;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Xavier Perseguers <xavier@typo3.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Autoloader included from Install Tool that lets DBAL load itself
- * if it makes sense.
- *
- * @author Xavier Perseguers <xavier@typo3.org>
- */
-class Autoloader {
-
-       /**
-        * Activates DBAL if it is supported.
-        *
-        * @param \TYPO3\CMS\Install\Installer $instObj
-        * @return void
-        */
-       public function execute(\TYPO3\CMS\Install\Installer $instObj) {
-               if ($instObj->mode == '123') {
-                       switch ($instObj->step) {
-                       case 1:
-                               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal') && $this->isDbalSupported()) {
-                                       $this->activateDbal();
-                                       // Reload page to have Install Tool actually load DBAL
-                                       $redirectUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL');
-                                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
-                               }
-                               break;
-                       case 2:
-                               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal') && $this->isDbalSupported()) {
-                                       $this->activateDbal();
-                               }
-                               break;
-                       case 3:
-                               $driver = $instObj->INSTALL['Database']['typo_db_driver'];
-                               if ($driver === 'mysql') {
-                                       $this->deactivateDbal();
-                               }
-                               break;
-                       }
-               }
-       }
-
-       /**
-        * Returns TRUE if PHP modules to run DBAL are loaded.
-        *
-        * @return boolean
-        */
-       protected function isDbalSupported() {
-               return extension_loaded('odbc') || extension_loaded('pdo') || extension_loaded('oci8');
-       }
-
-       /**
-        * Activates DBAL.
-        *
-        * @return void
-        */
-       protected function activateDbal() {
-               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')) {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('adodb');
-               }
-               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('dbal');
-               }
-       }
-
-       /**
-        * Dectivates DBAL.
-        *
-        * @return void
-        */
-       protected function deactivateDbal() {
-               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension('dbal');
-               }
-               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')) {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension('adodb');
-               }
-       }
-
-}
-
-
-?>
\ No newline at end of file
index 5c24978..9dd102c 100644 (file)
@@ -174,7 +174,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
        public $SQLparser;
 
        /**
-        * @var \TYPO3\CMS\Install\Sql\SchemaMigrator
+        * @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService
         */
        protected $installerSql = NULL;
 
@@ -192,7 +192,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
        public function __construct() {
                // Set SQL parser object for internal use:
                $this->SQLparser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\SqlParser');
-               $this->installerSql = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Sql\\SchemaMigrator');
+               $this->installerSql = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
                $this->queryCache = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('dbal');
                // Set internal variables with configuration:
                $this->conf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal'];
@@ -271,12 +271,14 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
         * @return void
         */
        protected function analyzeExtensionTables() {
-               foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $extensionConfiguration) {
-                       if (!is_array($extensionConfiguration) || !isset($extensionConfiguration['ext_tables.sql'])) {
-                               continue;
+               if (isset($GLOBALS['TYPO3_LOADED_EXT']) && is_array($GLOBALS['TYPO3_LOADED_EXT'])) {
+                       foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $extensionConfiguration) {
+                               if (!is_array($extensionConfiguration) || !isset($extensionConfiguration['ext_tables.sql'])) {
+                                       continue;
+                               }
+                               $extensionsSql = file_get_contents($extensionConfiguration['ext_tables.sql']);
+                               $this->parseAndAnalyzeSql($extensionsSql);
                        }
-                       $extensionsSql = file_get_contents($extensionConfiguration['ext_tables.sql']);
-                       $this->parseAndAnalyzeSql($extensionsSql);
                }
        }
 
@@ -318,7 +320,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
        /**
         * Analyzes fields and adds the extracted information to the field type, auto increment and primary key info caches.
         *
-        * @param array $parsedExtSQL The output produced by \TYPO3\CMS\Install\Sql\SchemaMigrator->getFieldDefinitions_fileContent()
+        * @param array $parsedExtSQL The output produced by \TYPO3\CMS\Install\Service\SqlSchemaMigrationService->getFieldDefinitions_fileContent()
         * @return void
         */
        protected function analyzeFields($parsedExtSQL) {
diff --git a/typo3/sysext/dbal/Classes/ExtensionManager/MessageDisplay.php b/typo3/sysext/dbal/Classes/ExtensionManager/MessageDisplay.php
deleted file mode 100644 (file)
index 26d31e8..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-namespace TYPO3\CMS\Dbal\ExtensionManager;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2009-2013 Xavier Perseguers <xavier@typo3.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Class that renders fields for the Extension Manager configuration.
- *
- * @author Xavier Perseguers <xavier@typo3.org>
- */
-class MessageDisplay {
-
-       /**
-        * Renders a message for EM.
-        *
-        * @return string
-        */
-       public function displayMessage() {
-               $out = '
-                       <div>
-                               <div class="typo3-message message-information">
-                                       <div class="message-header">PostgreSQL</div>
-                                       <div class="message-body">
-                                               If you use a PostgreSQL database, make sure to run SQL scripts located in<br />
-                                               <tt>' . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dbal') . 'res/postgresql/</tt><br />
-                                               to ensure best compatibility with TYPO3.
-                                       </div>
-                               </div>
-                       </div>
-               ';
-               return $out;
-       }
-
-}
-
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/dbal/Classes/Hooks/InstallToolHooks.php b/typo3/sysext/dbal/Classes/Hooks/InstallToolHooks.php
deleted file mode 100644 (file)
index 4d1cedf..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-<?php
-namespace TYPO3\CMS\Dbal\Hooks;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2010-2013 Xavier Perseguers <xavier@typo3.org>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Hooks for TYPO3 Install Tool.
- *
- * @author Xavier Perseguers <xavier@typo3.org>
- */
-class InstallToolHooks {
-
-       /**
-        * @var string
-        */
-       protected $templateFilePath = 'res/Templates/';
-
-       /**
-        * @var array
-        */
-       protected $supportedDrivers;
-
-       /**
-        * @var array
-        */
-       protected $availableDrivers;
-
-       /**
-        * @var string
-        */
-       protected $driver;
-
-       /**
-        * Default constructor.
-        */
-       public function __construct() {
-               $this->supportedDrivers = $this->getSupportedDrivers();
-               $this->availableDrivers = $this->getAvailableDrivers();
-               $configDriver =& $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driver'];
-               $this->driver = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('driver');
-               if (!$this->driver && $configDriver) {
-                       $this->driver = $configDriver;
-               }
-       }
-
-       /**
-        * Hooks into Installer to set required PHP modules.
-        *
-        * @param array $modules
-        * @param \TYPO3\CMS\Install\Installer|\TYPO3\CMS\Reports\Report\Status\SystemStatus $instObj
-        * @return array modules
-        */
-       public function setRequiredPhpModules(array $modules, $instObj) {
-               $modifiedModules = array();
-               foreach ($modules as $key => $module) {
-                       if ($module === 'mysql') {
-                               $dbModules = array();
-                               foreach ($this->supportedDrivers as $abstractionLayer => $drivers) {
-                                       foreach ($drivers as $driver) {
-                                               $dbModules = array_merge($dbModules, $driver['extensions']);
-                                       }
-                               }
-                               $module = $dbModules;
-                       }
-                       $modifiedModules[] = $module;
-               }
-               return $modifiedModules;
-       }
-
-       /**
-        * Hooks into Installer to let a non-MySQL database to be configured.
-        *
-        * @param array $markers
-        * @param integer $step
-        * @param \TYPO3\CMS\Install\Installer $instObj
-        * @return void
-        */
-       public function executeStepOutput(array &$markers, $step, \TYPO3\CMS\Install\Installer $instObj) {
-               switch ($step) {
-               case 2:
-                       $this->createConnectionForm($markers, $instObj);
-                       break;
-               case 3:
-                       $this->createDatabaseForm($markers, $instObj);
-                       break;
-               }
-       }
-
-       /**
-        * Hooks into Installer to modify lines to be written to localconf.php.
-        *
-        * @param array $lines This parameter is obsolet as of TYPO3 6.0
-        * @param integer $step
-        * @param \TYPO3\CMS\Install\Installer $instObj
-        * @return void
-        */
-       public function executeWriteLocalconf(array &$lines, $step, \TYPO3\CMS\Install\Installer $instObj) {
-               switch ($step) {
-               case 3:
-
-               case 4:
-                       $driver = $instObj->INSTALL['Database']['typo_db_driver'];
-                       if (!$driver && $this->driver) {
-                               // Driver was already configured
-                               break;
-                       }
-                       $driverConfig = '';
-                       switch ($driver) {
-                       case 'oci8':
-                               $driverConfig = array(
-                                       'driverOptions' => array(
-                                               'connectSID' => $instObj->INSTALL['Database']['typo_db_type'] === 'sid' ? TRUE : FALSE
-                                       )
-                               );
-                               break;
-                       case 'mssql':
-
-                       case 'odbc_mssql':
-                               $driverConfig = array(
-                                       'useNameQuote' => TRUE,
-                                       'quoteClob' => FALSE
-                               );
-                               break;
-                       case 'mysql':
-                               return;
-                       }
-                       $config = array(
-                               '_DEFAULT' => array(
-                                       'type' => 'adodb',
-                                       'config' => array(
-                                               'driver' => $driver,
-                                               $driverConfig
-                                       )
-                               )
-                       );
-                       \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValuesByPathValuePairs(array('EXTCONF/dbal/handlerCfg' => $config));
-                       break;
-               }
-       }
-
-       /**
-        * Creates a specialized form to configure the DBMS connection.
-        *
-        * @param array $markers
-        * @param \TYPO3\CMS\Install\Installer $instObj
-        * @return void
-        */
-       protected function createConnectionForm(array &$markers, \TYPO3\CMS\Install\Installer $instObj) {
-               // Normalize current driver
-               if (!$this->driver) {
-                       $this->driver = $this->getDefaultDriver();
-               }
-               // Get the template file
-               $templateFile = @file_get_contents((\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dbal') . $this->templateFilePath . 'install.html'));
-               // Get the template part from the file
-               $template = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($templateFile, '###TEMPLATE###');
-               // Get the subpart for the connection form
-               $formSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###CONNECTION_FORM###');
-               if ($this->getNumberOfAvailableDrivers() == 1 && $this->getDefaultDriver() === 'mysql') {
-                       // Only MySQL is actually available (PDO support may be compiled in
-                       // PHP itself and as such DBAL was activated, behaves as if DBAL were
-                       // not activated
-                       $driverSubPart = '<input type="hidden" name="TYPO3_INSTALL[Database][typo_db_driver]" value="mysql" />';
-               } else {
-                       $driverTemplate = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($formSubPart, '###DATABASE_DRIVER###');
-                       $driverSubPart = $this->prepareDatabaseDrivers($driverTemplate);
-               }
-               $formSubPart = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($formSubPart, '###DATABASE_DRIVER###', $driverSubPart);
-               // Get the subpart related to selected database driver
-               if ($this->driver === '' || $this->driver === 'mysql') {
-                       $driverOptionsSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###DRIVER_MYSQL###');
-               } else {
-                       $driverOptionsSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###DRIVER_' . \TYPO3\CMS\Core\Utility\GeneralUtility::strtoupper($this->driver) . '###');
-                       if ($driverOptionsSubPart === '') {
-                               $driverOptionsSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###DRIVER_DEFAULT###');
-                       }
-               }
-               // Define driver-specific markers
-               $driverMarkers = array();
-               switch ($this->driver) {
-               case 'mssql':
-                       $driverMarkers = array(
-                               'labelUsername' => 'Username',
-                               'username' => TYPO3_db_username,
-                               'labelPassword' => 'Password',
-                               'password' => TYPO3_db_password,
-                               'labelHost' => 'Host',
-                               'host' => TYPO3_db_host ? TYPO3_db_host : 'windows',
-                               'labelDatabase' => 'Database',
-                               'database' => TYPO3_db
-                       );
-                       $nextStep = $instObj->step + 2;
-                       break;
-               case 'odbc_mssql':
-                       $driverMarkers = array(
-                               'labelUsername' => 'Username',
-                               'username' => TYPO3_db_username,
-                               'labelPassword' => 'Password',
-                               'password' => TYPO3_db_password,
-                               'labelHost' => 'Host',
-                               'host' => TYPO3_db_host ? TYPO3_db_host : 'windows',
-                               'database' => 'dummy_string'
-                       );
-                       $nextStep = $instObj->step + 2;
-                       break;
-               case 'oci8':
-                       $driverMarkers = array(
-                               'labelUsername' => 'Username',
-                               'username' => TYPO3_db_username,
-                               'labelPassword' => 'Password',
-                               'password' => TYPO3_db_password,
-                               'labelHost' => 'Host',
-                               'host' => TYPO3_db_host ? TYPO3_db_host : 'localhost',
-                               'labelType' => 'Type',
-                               'labelSID' => 'SID',
-                               'labelServiceName' => 'Service Name',
-                               'labelDatabase' => 'Name',
-                               'database' => TYPO3_db
-                       );
-                       $nextStep = $instObj->step + 2;
-                       break;
-               case 'postgres':
-                       $driverMarkers = array(
-                               'labelUsername' => 'Username',
-                               'username' => TYPO3_db_username,
-                               'labelPassword' => 'Password',
-                               'password' => TYPO3_db_password,
-                               'labelHost' => 'Host',
-                               'host' => TYPO3_db_host ? TYPO3_db_host : 'localhost',
-                               'labelDatabase' => 'Database',
-                               'database' => TYPO3_db
-                       );
-                       $nextStep = $instObj->step + 2;
-                       break;
-               default:
-                       $driverMarkers = array(
-                               'labelUsername' => 'Username',
-                               'username' => TYPO3_db_username,
-                               'labelPassword' => 'Password',
-                               'password' => TYPO3_db_password,
-                               'labelHost' => 'Host',
-                               'host' => TYPO3_db_host ? TYPO3_db_host : 'localhost',
-                               'labelDatabase' => 'Database',
-                               'database' => TYPO3_db
-                       );
-                       $nextStep = $instObj->step + 1;
-                       break;
-               }
-               // Add header marker for main template
-               $markers['header'] = 'Connect to your database host';
-               // Define the markers content for the subpart
-               $subPartMarkers = array(
-                       'step' => $nextStep,
-                       'action' => htmlspecialchars($instObj->action),
-                       'encryptionKey' => $instObj->createEncryptionKey(),
-                       'branch' => TYPO3_branch,
-                       'driver_options' => $driverOptionsSubPart,
-                       'continue' => 'Continue',
-                       'llDescription' => 'If you have not already created a username and password to access the database, please do so now. This can be done using tools provided by your host.'
-               );
-               $subPartMarkers = array_merge($subPartMarkers, $driverMarkers);
-               // Add step marker for main template
-               $markers['step'] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($formSubPart, $subPartMarkers, '###|###', 1, 1);
-       }
-
-       /**
-        * Prepares the list of database drivers for step 2.
-        *
-        * @param string $template
-        * @return string
-        */
-       protected function prepareDatabaseDrivers($template) {
-               $subParts = array(
-                       'abstractionLayer' => \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###ABSTRACTION_LAYER###'),
-                       'vendor' => \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###VENDOR###')
-               );
-               // Create the drop-down list of available drivers
-               $dropdown = '';
-               foreach ($this->availableDrivers as $abstractionLayer => $drivers) {
-                       $options = array();
-                       foreach ($drivers as $driver => $label) {
-                               $markers = array(
-                                       'driver' => $driver,
-                                       'labelvendor' => $label,
-                                       'onclick' => 'document.location=\'index.php?TYPO3_INSTALL[type]=config&mode=123&step=2&driver=' . $driver . '\';',
-                                       'selected' => ''
-                               );
-                               if ($driver === $this->driver) {
-                                       $markers['selected'] .= ' selected="selected"';
-                               }
-                               $options[] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($subParts['vendor'], $markers, '###|###', 1);
-                       }
-                       $subPart = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($subParts['abstractionLayer'], '###VENDOR###', implode('
-', $options));
-                       $dropdown .= \TYPO3\CMS\Core\Html\HtmlParser::substituteMarker($subPart, '###LABELABSTRACTIONLAYER###', $abstractionLayer);
-               }
-               $form = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($template, '###ABSTRACTION_LAYER###', $dropdown);
-               $form = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarker($form, '###LABELDRIVER###', 'Driver');
-               return $form;
-       }
-
-       /**
-        * Returns a list of DBAL supported database drivers, with a user-friendly name
-        * and any PHP module dependency.
-        *
-        * @return array
-        */
-       protected function getSupportedDrivers() {
-               $supportedDrivers = array(
-                       'Native' => array(
-                               'mysql' => array(
-                                       'label' => 'MySQL/MySQLi (recommended)',
-                                       'combine' => 'OR',
-                                       'extensions' => array('mysql', 'mysqli')
-                               ),
-                               'mssql' => array(
-                                       'label' => 'Microsoft SQL Server',
-                                       'extensions' => array('mssql')
-                               ),
-                               'oci8' => array(
-                                       'label' => 'Oracle OCI8',
-                                       'extensions' => array('oci8')
-                               ),
-                               'postgres' => array(
-                                       'label' => 'PostgreSQL',
-                                       'extensions' => array('pgsql')
-                               )
-                       ),
-                       'ODBC' => array(
-                               'odbc_mssql' => array(
-                                       'label' => 'Microsoft SQL Server',
-                                       'extensions' => array('odbc', 'mssql')
-                               )
-                       )
-               );
-               return $supportedDrivers;
-       }
-
-       /**
-        * Returns a list of database drivers that are available on current server.
-        *
-        * @return array
-        */
-       protected function getAvailableDrivers() {
-               $availableDrivers = array();
-               foreach ($this->supportedDrivers as $abstractionLayer => $drivers) {
-                       foreach ($drivers as $driver => $info) {
-                               if (isset($info['combine']) && $info['combine'] === 'OR') {
-                                       $isAvailable = FALSE;
-                               } else {
-                                       $isAvailable = TRUE;
-                               }
-                               // Loop through each PHP module dependency to ensure it is loaded
-                               foreach ($info['extensions'] as $extension) {
-                                       if (isset($info['combine']) && $info['combine'] === 'OR') {
-                                               $isAvailable |= extension_loaded($extension);
-                                       } else {
-                                               $isAvailable &= extension_loaded($extension);
-                                       }
-                               }
-                               if ($isAvailable) {
-                                       if (!isset($availableDrivers[$abstractionLayer])) {
-                                               $availableDrivers[$abstractionLayer] = array();
-                                       }
-                                       $availableDrivers[$abstractionLayer][$driver] = $info['label'];
-                               }
-                       }
-               }
-               return $availableDrivers;
-       }
-
-       /**
-        * Returns the number of available drivers.
-        *
-        * @return boolean
-        */
-       protected function getNumberOfAvailableDrivers() {
-               $count = 0;
-               foreach ($this->availableDrivers as $drivers) {
-                       $count += count($drivers);
-               }
-               return $count;
-       }
-
-       /**
-        * Returns the driver that is selected by default in the
-        * Install Tool dropdown list.
-        *
-        * @return string
-        */
-       protected function getDefaultDriver() {
-               $defaultDriver = '';
-               if (count($this->availableDrivers)) {
-                       $abstractionLayers = array_keys($this->availableDrivers);
-                       $drivers = array_keys($this->availableDrivers[$abstractionLayers[0]]);
-                       $defaultDriver = $drivers[0];
-               }
-               return $defaultDriver;
-       }
-
-       /**
-        * Creates a specialized form to configure the database.
-        *
-        * @param array $markers
-        * @param \TYPO3\CMS\Install\Installer $instObj
-        */
-       protected function createDatabaseForm(array &$markers, \TYPO3\CMS\Install\Installer $instObj) {
-               $error_missingConnect = '
-                       <p class="typo3-message message-error">
-                               <strong>
-                                       There is no connection to the database!
-                               </strong>
-                               <br />
-                               (Username: <em>' . TYPO3_db_username . '</em>,
-                               Host: <em>' . TYPO3_db_host . '</em>,
-                               Using Password: YES)
-                               <br />
-                               Go to Step 1 and enter a valid username and password!
-                       </p>
-               ';
-               // Add header marker for main template
-               $markers['header'] = 'Select database';
-               // There should be a database host connection at this point
-               if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
-                       // Get the template file
-                       $templateFile = @file_get_contents((\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dbal') . $this->templateFilePath . 'install.html'));
-                       // Get the template part from the file
-                       $template = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($templateFile, '###TEMPLATE###');
-                       // Get the subpart for the database choice step
-                       $formSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($template, '###DATABASE_FORM###');
-                       // Get the subpart for the database options
-                       $step3DatabaseOptionsSubPart = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($formSubPart, '###DATABASEOPTIONS###');
-                       $dbArr = $instObj->getDatabaseList();
-                       $dbIncluded = FALSE;
-                       foreach ($dbArr as $dbname) {
-                               // Define the markers content for database options
-                               $step3DatabaseOptionMarkers = array(
-                                       'databaseValue' => htmlspecialchars($dbname),
-                                       'databaseSelected' => $dbname === TYPO3_db ? 'selected="selected"' : '',
-                                       'databaseName' => htmlspecialchars($dbname)
-                               );
-                               // Add the option HTML to an array
-                               $step3DatabaseOptions[] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($step3DatabaseOptionsSubPart, $step3DatabaseOptionMarkers, '###|###', 1, 1);
-                               if ($dbname === TYPO3_db) {
-                                       $dbIncluded = TRUE;
-                               }
-                       }
-                       if (!$dbIncluded && TYPO3_db) {
-                               // // Define the markers content when no access
-                               $step3DatabaseOptionMarkers = array(
-                                       'databaseValue' => htmlspecialchars(TYPO3_db),
-                                       'databaseSelected' => 'selected="selected"',
-                                       'databaseName' => htmlspecialchars(TYPO3_db) . ' (NO ACCESS!)'
-                               );
-                               // Add the option HTML to an array
-                               $step3DatabaseOptions[] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($step3DatabaseOptionsSubPart, $step3DatabaseOptionMarkers, '###|###', 1, 1);
-                       }
-                       // Substitute the subpart for the database options
-                       $content = \TYPO3\CMS\Core\Html\HtmlParser::substituteSubpart($formSubPart, '###DATABASEOPTIONS###', implode(chr(10), $step3DatabaseOptions));
-                       // Define the markers content
-                       $step3SubPartMarkers = array(
-                               'step' => $instObj->step + 1,
-                               'action' => htmlspecialchars($instObj->action),
-                               'llOption2' => 'Select an EMPTY existing database:',
-                               'llRemark2' => 'Any tables used by TYPO3 will be overwritten.',
-                               'continue' => 'Continue'
-                       );
-                       // Add step marker for main template
-                       $markers['step'] = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($content, $step3SubPartMarkers, '###|###', 1, 1);
-               } else {
-                       // Add step marker for main template when no connection
-                       $markers['step'] = $error_missingConnect;
-               }
-       }
-
-}
-
-
-?>
index 9b5e54c..9970a0a 100644 (file)
@@ -1,9 +1,6 @@
 <?php
 return array(
-       'tx_dbal_autoloader' => 'TYPO3\\CMS\\Dbal\\Autoloader',
        'tx_dbal_module1' => 'TYPO3\\CMS\\Dbal\\Controller\\ModuleController',
-       'tx_dbal_tsparserext' => 'TYPO3\\CMS\\Dbal\\ExtensionManager\\MessageDisplay',
-       'tx_dbal_installtool' => 'TYPO3\\CMS\\Dbal\\Hooks\\InstallToolHooks',
        'tx_dbal_querycache' => 'TYPO3\\CMS\\Dbal\\QueryCache',
        'ux_t3lib_DB' => 'TYPO3\\CMS\\Dbal\\Database\\DatabaseConnection',
        'ux_t3lib_sqlparser' => 'TYPO3\\CMS\\Dbal\\Database\\SqlParser',
index 6161921..2803b18 100644 (file)
@@ -7,11 +7,6 @@ $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Database\\Datab
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Core\\Database\\SqlParser'] = array('className' => 'TYPO3\\CMS\\Dbal\\Database\\SqlParser');
 $GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects']['TYPO3\\CMS\\Recordlist\\RecordList\\DatabaseRecordList'] = array('className' => 'TYPO3\\CMS\\Dbal\\RecordList\\DatabaseRecordList');
 
-// Register a hook for the installer
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['stepOutput'][] = 'TYPO3\\CMS\\Dbal\\Hooks\\InstallToolHooks';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['writeLocalconf'][] = 'TYPO3\\CMS\\Dbal\\Hooks\\InstallToolHooks';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install/mod/class.tx_install.php']['requiredPhpModules'][] = 'TYPO3\\CMS\\Dbal\\Hooks\\InstallToolHooks';
-
 // Register caches if not already done in localconf.php or a previously loaded extension.
 if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal'])) {
        $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal'] = array(
index 9870dd2..cd0d233 100644 (file)
@@ -39,7 +39,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
        public $objectManager;
 
        /**
-        * @var \TYPO3\CMS\Install\Sql\SchemaMigrator
+        * @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService
         */
        public $installToolSqlParser;
 
@@ -115,8 +115,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
         */
        public function __construct() {
                $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
-               /** @var $installToolSqlParser \TYPO3\CMS\Install\Sql\SchemaMigrator */
-               $this->installToolSqlParser = $this->objectManager->get('TYPO3\\CMS\\Install\\Sql\\SchemaMigrator');
+               /** @var $installToolSqlParser \TYPO3\CMS\Install\Service\SqlSchemaMigrationService */
+               $this->installToolSqlParser = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
                $this->dependencyUtility = $this->objectManager->get('TYPO3\\CMS\\Extensionmanager\\Utility\\DependencyUtility');
        }
 
diff --git a/typo3/sysext/install/Classes/CheckTheDatabaseHookInterface.php b/typo3/sysext/install/Classes/CheckTheDatabaseHookInterface.php
deleted file mode 100644 (file)
index 1492435..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install;
-
-/***************************************************************
- *  Copyright notice
- *
- *  (c) 2011-2013 Thomas Maroschik <tmaroschik@dfau.de>
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *  A copy is found in the textfile GPL.txt and important notices to the license
- *  from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-/**
- * Interface for hook in tx_install::checkTheDatabase
- *
- * @author Thomas Maroschik <tmaroschik@dfau.de>
- */
-interface CheckTheDatabaseHookInterface
-{
-       /**
-        * Hook that allows to dynamically extend the table definitions on a per extension base
-        * for e.g. custom caches. The hook implementation may return table create strings that
-        * will be respected by the install tool.
-        *
-        * @param string $extKey: Extension key
-        * @param array $loadedExtConf: The extension's configuration from $GLOBALS['TYPO3_LOADED_EXT']
-        * @param string $extensionSqlContent: The content of the extensions ext_tables.sql
-        * @param \TYPO3\CMS\Install\Sql\SchemaMigrator $instSqlObj: Instance of the installer sql object
-        * @param tx_em_Install $parent: The calling parent object
-        * @return string Either empty string or table create strings
-        */
-       public function appendExtensionTableDefinitions($extKey, array $loadedExtConf, $extensionSqlContent, \TYPO3\CMS\Install\Sql\SchemaMigrator $instSqlObj, \TYPO3\CMS\Install\Installer $parent);
-
-       /**
-        * Hook that allows to dynamically extend the table definitions for the whole system
-        * for e.g. custom caches. The hook implementation may return table create strings that
-        * will be respected by the install tool.
-        *
-        * @param string $allSqlContent: The content of all relevant sql files
-        * @param \TYPO3\CMS\Install\Sql\SchemaMigrator $instSqlObj: Instance of the installer sql object
-        * @param tx_em_Install $parent: The calling parent object
-        * @return string Either empty string or table create strings
-        */
-       public function appendGlobalTableDefinitions($allSqlContent, \TYPO3\CMS\Install\Sql\SchemaMigrator $instSqlObj, \TYPO3\CMS\Install\Installer $parent);
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/AbstractController.php b/typo3/sysext/install/Classes/Controller/AbstractController.php
new file mode 100644 (file)
index 0000000..cd8ff05
--- /dev/null
@@ -0,0 +1,510 @@
+<?php
+namespace TYPO3\CMS\Install\Controller;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Controller abstract for shared parts of Tool and Step controller
+ */
+class AbstractController {
+
+       /**
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        */
+       protected $objectManager = NULL;
+
+       /**
+        * @var \TYPO3\CMS\Install\Service\SessionService
+        */
+       protected $session = NULL;
+
+       /**
+        * @var array List of valid action names that need authentication
+        */
+       protected $authenticationActions = array();
+
+       /**
+        * Guard method checking typo3conf/ENABLE_INSTALL_TOOL
+        *
+        * Checking ENABLE_INSTALL_TOOL validity is simple:
+        * As soon as there is a typo3conf directory at all (not step 1 of "first install"),
+        * the file must be there and valid in order to proceed.
+        *
+        * @return void
+        */
+       protected function outputInstallToolNotEnabledMessageIfNeeded() {
+               if (is_dir(PATH_typo3conf)) {
+                       /** @var \TYPO3\CMS\Install\Service\EnableFileService $installToolEnableService */
+                       $installToolEnableService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\EnableFileService');
+                       if (!$installToolEnableService->checkInstallToolEnableFile()) {
+                               /** @var \TYPO3\CMS\Install\Controller\Action\ActionInterface $action */
+                               $action = $this->objectManager->get('TYPO3\\CMS\\Install\\Controller\\Action\\Common\\InstallToolDisabledAction');
+                               $action->setController('common');
+                               $action->setAction('installToolDisabled');
+                               $this->output($action->handle());
+                       }
+               }
+       }
+
+       /**
+        * Guard method checking for valid install tool password
+        *
+        * If installation is completed - LocalConfiguration exists and
+        * installProcess is not running, and installToolPassword must be set
+        */
+       protected function outputInstallToolPasswordNotSetMessageIfNeeded() {
+               if (!$this->isInitialInstallationInProgress()
+                       && (empty($GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword']))
+               ) {
+                       /** @var \TYPO3\CMS\Install\Controller\Action\ActionInterface $action */
+                       $action = $this->objectManager->get('TYPO3\\CMS\\Install\\Controller\\Action\\Common\\InstallToolPasswordNotSetAction');
+                       $action->setController('common');
+                       $action->setAction('installToolPasswordNotSet');
+                       $this->output($action->handle());
+               }
+       }
+
+       /**
+        * Use form protection API to find out if protected POST forms are ok.
+        *
+        * @throws Exception
+        * @return void
+        */
+       protected function checkSessionToken() {
+               $postValues = $this->getPostValues();
+               $tokenOk = FALSE;
+               if (count($postValues) > 0) {
+                       // A token must be given as soon as there is POST data
+                       if (isset($postValues['token'])) {
+                               /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
+                               $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
+                                       'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection'
+                               );
+                               $action = $this->getAction();
+                               if ($action === '') {
+                                       throw new Exception(
+                                               'No POST action given for token check',
+                                               1369326593
+                                       );
+                               }
+                               $tokenOk = $formProtection->validateToken($postValues['token'], 'installTool', $action);
+                       }
+               } else {
+                       $tokenOk = TRUE;
+               }
+
+               if (!$tokenOk) {
+                       $this->session->resetSession();
+                       $this->session->startSession();
+
+                       if ($this->isInitialInstallationInProgress()) {
+                               $this->redirect();
+                       } else {
+                               /** @var $message \TYPO3\CMS\Install\Status\ErrorStatus */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Invalid form token');
+                               $message->setMessage(
+                                       'The form protection token was invalid. You have been logged out, please login and try again.'
+                               );
+                               $this->output($this->loginForm($message));
+                       }
+               }
+       }
+
+       /**
+        * Check if session expired.
+        *
+        * @return void
+        */
+       protected function checkSessionLifetime() {
+               if ($this->session->isExpired()) {
+                       // Session expired, log out user, start new session
+                       $this->session->resetSession();
+                       $this->session->startSession();
+
+                       if ($this->isInitialInstallationInProgress()) {
+                               $this->redirect();
+                       } else {
+                               /** @var $message \TYPO3\CMS\Install\Status\ErrorStatus */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Session expired');
+                               $message->setMessage(
+                                       'Your Install Tool session has expired. You have been logged out, please login and try again.'
+                               );
+                               $this->output($this->loginForm($message));
+                       }
+               }
+       }
+
+       /**
+        * Show login form
+        *
+        * @param \TYPO3\CMS\Install\Status\StatusInterface $message Optional status message from controller
+        * @return string Rendered HTML
+        */
+       protected function loginForm(\TYPO3\CMS\Install\Status\StatusInterface $message = NULL) {
+               /** @var \TYPO3\CMS\Install\Controller\Action\Common\LoginForm $action */
+               $action = $this->objectManager->get('TYPO3\\CMS\\Install\\Controller\\Action\\Common\\LoginForm');
+               $action->setController('common');
+               $action->setAction('login');
+               $action->setToken($this->generateTokenForAction('login'));
+               $action->setPostValues($this->getPostValues());
+               if ($message) {
+                       $action->setMessages(array($message));
+               }
+               $content = $action->handle();
+               return $content;
+       }
+
+       /**
+        * Validate install tool password and login user if requested
+        *
+        * @return void
+        */
+       protected function loginIfRequested() {
+               $action = $this->getAction();
+               $postValues = $this->getPostValues();
+               if ($action === 'login') {
+                       if (isset($postValues['values']['password'])
+                               && md5($postValues['values']['password']) === $GLOBALS['TYPO3_CONF_VARS']['BE']['installToolPassword']
+                       ) {
+                               $this->session->setAuthorized();
+                               $this->sendLoginSuccessfulMail();
+                               $this->redirect();
+                       } else {
+                               /** @var $message \TYPO3\CMS\Install\Status\ErrorStatus */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Login failed');
+                               $message->setMessage('Given password does not match the install tool login password.');
+                               $this->sendLoginFailedMail();
+                               $this->output($this->loginForm($message));
+                       }
+               }
+       }
+
+       /**
+        * Show login for if user is not authorized yet and if
+        * not in first installation process.
+        *
+        * @return void
+        */
+       protected function outputLoginFormIfNotAuthorized() {
+               if (!$this->session->isAuthorized()
+                       && !$this->isInitialInstallationInProgress()
+               ) {
+                       $this->output($this->loginForm());
+               } else {
+                       $this->session->refreshSession();
+               }
+       }
+
+       /**
+        * If install tool login mail is set, send a mail for a successful login.
+        * This is currently straight ahead code and could be improved.
+        *
+        * @return void
+        */
+       protected function sendLoginSuccessfulMail() {
+               $warningEmailAddress = $GLOBALS['TYPO3_CONF_VARS']['BE']['warning_email_addr'];
+               if ($warningEmailAddress) {
+                       $subject = 'Install Tool Login at \'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\'';
+                       $body =
+                               'There has been an Install Tool login at TYPO3 site'
+                               . ' \'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\''
+                               . ' (' . GeneralUtility::getIndpEnv('HTTP_HOST') . ')'
+                               . ' from remote address \'' . GeneralUtility::getIndpEnv('REMOTE_ADDR') . '\''
+                               . ' (' . GeneralUtility::getIndpEnv('REMOTE_HOST') . ')';
+                       mail($warningEmailAddress, $subject, $body, 'From: TYPO3 Install Tool WARNING <>');
+               }
+       }
+
+       /**
+        * If install tool login mail is set, send a mail for a failed login.
+        * This is currently straight ahead code and could be improved.
+        *
+        * @return void
+        */
+       protected function sendLoginFailedMail() {
+               $formValues = GeneralUtility::_GP('install');
+               $warningEmailAddress = $GLOBALS['TYPO3_CONF_VARS']['BE']['warning_email_addr'];
+               if ($warningEmailAddress) {
+                       $subject = 'Install Tool Login ATTEMPT at \'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\'';
+                       $body =
+                               'There has been an Install Tool login attempt at TYPO3 site'
+                               . ' \'' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] . '\''
+                               . ' (' . GeneralUtility::getIndpEnv('HTTP_HOST') . ')'
+                               . ' The MD5 hash of the last 5 characters of the password tried was \'' . substr(md5($formValues['password']), -5) . '\''
+                               . ' remote addres was \'' . GeneralUtility::getIndpEnv('REMOTE_ADDR') . '\''
+                               . ' (' . GeneralUtility::getIndpEnv('REMOTE_HOST') . ')';
+                       mail($warningEmailAddress, $subject, $body, 'From: TYPO3 Install Tool WARNING <>');
+               }
+       }
+
+       /**
+        * Generate token for specific action
+        *
+        * @param string $action Action name
+        * @return string Form protection token
+        * @throws Exception
+        */
+       protected function generateTokenForAction($action = NULL) {
+               if (!$action) {
+                       $action = $this->getAction();
+               }
+               if ($action === '') {
+                       throw new Exception(
+                               'Token must have a valid action name',
+                               1369326592
+                       );
+               }
+               /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
+               $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
+                       'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection'
+               );
+               return $formProtection->generateToken('installTool', $action);
+       }
+
+       /**
+        * First installation is in progress, if LocalConfiguration does not exist,
+        * or if isInitialInstallationInProgress is not set or FALSE.
+        *
+        * @return boolean TRUE if installation is in progress
+        */
+       protected function isInitialInstallationInProgress() {
+               /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+
+               $localConfigurationFileLocation = $configurationManager->getLocalConfigurationFileLocation();
+               $localConfigurationFileExists = @is_file($localConfigurationFileLocation);
+               $result = FALSE;
+               if (!$localConfigurationFileExists
+                       || !empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['isInitialInstallationInProgress'])
+               ) {
+                       $result = TRUE;
+               }
+               return $result;
+       }
+
+       /**
+        * Initialize session object.
+        * Subclass will throw exception if session can not be created or if
+        * preconditions like a valid encryption key are not set.
+        *
+        * @return void
+        */
+       protected function initializeSession() {
+               /** @var \TYPO3\CMS\Install\Service\SessionService $session */
+               $this->session = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SessionService');
+               if (!$this->session->hasSession()) {
+                       $this->session->startSession();
+               }
+       }
+
+       /**
+        * Add status messages to session.
+        * Used to output messages between requests, especially in step controller
+        *
+        * @param array<\TYPO3\CMS\Install\Status\StatusInterface> $messages
+        */
+       protected function addSessionMessages(array $messages) {
+               foreach ($messages as $message) {
+                       $this->session->addMessage($message);
+               }
+       }
+
+       /**
+        * Initialize extbase object manager for fluid rendering
+        *
+        * @return void
+        */
+       protected function initializeObjectManager() {
+               /** @var \TYPO3\CMS\Extbase\Object\ObjectManager $objectManager */
+               $objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
+               $this->objectManager = $objectManager;
+       }
+
+       /**
+        * Require dbal ext_localconf if extension is loaded
+        * Required extbase + fluid ext_localconf
+        * Set caching to null, we do not want dbal, fluid or extbase to cache anything
+        *
+        * @return void
+        */
+       protected function loadBaseExtensions() {
+               if ($this->isDbalEnabled()) {
+                       require(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dbal') . 'ext_localconf.php');
+                       $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['dbal']['backend']
+                               = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               }
+
+               require(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('extbase') . 'ext_localconf.php');
+               require(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('fluid') . 'ext_localconf.php');
+
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_datamapfactory_datamap']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_typo3dbbackend_tablecolumns']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+               $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['fluid_template']['backend']
+                       = 'TYPO3\\CMS\\Core\\Cache\\Backend\\NullBackend';
+
+               /** @var $cacheManager \TYPO3\CMS\Core\Cache\CacheManager */
+               $cacheManager = $GLOBALS['typo3CacheManager'];
+               $cacheManager->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
+       }
+
+       /**
+        * Return TRUE if dbal and adodb extension is loaded.
+        *
+        * @return boolean TRUE if dbal and adodb is loaded
+        */
+       protected function isDbalEnabled() {
+               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')
+                       && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')
+               ) {
+                       return TRUE;
+               }
+               return FALSE;
+       }
+
+       /**
+        * Check given action name is one of the allowed actions.
+        *
+        * @param string $action Given action to validate
+        * @throws Exception
+        */
+       protected function validateAuthenticationAction($action) {
+               if (!in_array($action, $this->authenticationActions)) {
+                       throw new Exception(
+                               $action . ' is not a valid authentication action',
+                               1369345838
+                       );
+               }
+       }
+
+       /**
+        * Retrieve parameter from GET or POST and sanitize
+        *
+        * @throws Exception
+        * @return string Empty string if no action is given or sanitized action string
+        */
+       protected function getAction() {
+               $formValues = GeneralUtility::_GP('install');
+               $action = '';
+               if (isset($formValues['action'])) {
+                       $action = $formValues['action'];
+               }
+               if ($action !== ''
+                       && $action !== 'login'
+                       && $action !== 'loginForm'
+                       && $action !== 'logout'
+                       && !in_array($action, $this->authenticationActions)
+               ) {
+                       throw new Exception(
+                               'Invalid action ' . $action,
+                               1369325619
+                       );
+               }
+               return $action;
+       }
+
+       /**
+        * Get POST form values of install tool.
+        * All POST data is secured by form token protection, except in very installation step.
+        *
+        * @return array
+        */
+       protected function getPostValues() {
+               $postValues = GeneralUtility::_POST('install');
+               if (!is_array($postValues)) {
+                       $postValues = array();
+               }
+               return $postValues;
+       }
+
+       /**
+        * HTTP redirect to self, preserving allowed GET variables.
+        * WARNING: This exits the script execution!
+        *
+        * @param string $controller Can be set to 'tool' to redirect from step to tool controller
+        * @param string $action Set specific action for next request, used in step controller to specify next step
+        * @return void
+        */
+       protected function redirect($controller = '', $action = '') {
+               $getPostValues = GeneralUtility::_GP('install');
+
+               $parameters = array();
+
+               // Add context parameter in case this script was called within backend scope
+               $context = 'install[context]=standalone';
+               if (isset($getPostValues['context']) && $getPostValues['context'] === 'backend') {
+                       $context = 'install[context]=backend';
+               }
+               $parameters[] = $context;
+
+               // Add controller parameter
+               $controllerParameter = 'install[controller]=step';
+               if ((isset($getPostValues['controller']) && $getPostValues['controller'] === 'tool')
+                       || $controller === 'tool'
+               ) {
+                       $controllerParameter = 'install[controller]=tool';
+               }
+               $parameters[] = $controllerParameter;
+
+               // Add action if specified
+               if (strlen($action) > 0) {
+                       $parameters[] = 'install[action]=' . $action;
+               }
+
+               $redirectLocation= 'Install.php?' . implode('&', $parameters);
+
+               \TYPO3\CMS\Core\Utility\HttpUtility::redirect(
+                       $redirectLocation,
+                       \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303
+               );
+       }
+
+       /**
+        * Output content.
+        * WARNING: This exits the script execution!
+        *
+        * @param string $content Content to output
+        */
+       protected function output($content = '') {
+               header('Content-Type: text/html; charset=utf-8');
+               header('Cache-Control: no-cache, must-revalidate');
+               header('Pragma: no-cache');
+               echo $content;
+               die;
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php b/typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
new file mode 100644 (file)
index 0000000..df894b2
--- /dev/null
@@ -0,0 +1,211 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * General purpose controller action helper methods and bootstrap
+ */
+abstract class AbstractAction {
+
+       /**
+        * @var \TYPO3\CMS\Extbase\Object\ObjectManager
+        * @inject
+        */
+       protected $objectManager = NULL;
+
+       /**
+        * @var \TYPO3\CMS\Install\View\StandaloneView
+        * @inject
+        */
+       protected $view = NULL;
+
+       /**
+        * @var string Name of controller. One of the strings 'step', 'tool' or 'common'
+        */
+       protected $controller = '';
+
+       /**
+        * @var string Name of target action, set by controller
+        */
+       protected $action = '';
+
+       /**
+        * @var string Form token for CSRF protection
+        */
+       protected $token = '';
+
+       /**
+        * @var array Values in $_POST['install']
+        */
+       protected $postValues = array();
+
+       /**
+        * @var array<\TYPO3\CMS\Install\Status\StatusInterface> Optional status message from controller
+        */
+       protected $messages = array();
+
+       /**
+        * Initialize this action
+        *
+        * @return string content
+        */
+       protected function initialize() {
+               $viewRootPath = GeneralUtility::getFileAbsFileName('EXT:install/Resources/Private/');
+               $controllerActionDirectoryName = ucfirst($this->controller);
+               $mainTemplate = ucfirst($this->action);
+               $this->view->setTemplatePathAndFilename($viewRootPath . 'Templates/Action/' . $controllerActionDirectoryName . '/' . $mainTemplate . '.html');
+               $this->view->setLayoutRootPath($viewRootPath . 'Layouts/');
+               $this->view->setPartialRootPath($viewRootPath . 'Partials/');
+               $this->view
+                       // time is used in js and css as parameter to force loading of resources
+                       ->assign('time', time())
+                       ->assign('action', $this->action)
+                       ->assign('controller', $this->controller)
+                       ->assign('token', $this->token)
+                       ->assign('context', $this->getContext())
+                       ->assign('messages', $this->messages)
+                       ->assign('typo3Version', TYPO3_version)
+                       ->assign('siteName', $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']);
+       }
+
+       /**
+        * Set form protection token
+        *
+        * @param string $token Form protection token
+        * @return void
+        */
+       public function setToken($token) {
+               $this->token = $token;
+       }
+
+       /**
+        * Set action group. Either string 'step', 'tool' or 'common'
+        *
+        * @param string $controller Controller name
+        * @return void
+        */
+       public function setController($controller) {
+               $this->controller = $controller;
+       }
+
+       /**
+        * Set action name. This is usually similar to the class name,
+        * only for loginForm, the action is login
+        *
+        * @param string $action Name of target action for forms
+        * @return void
+        */
+       public function setAction($action) {
+               $this->action = $action;
+       }
+
+       /**
+        * Set POST form values of install tool
+        *
+        * @param array $postValues
+        * @return void
+        */
+       public function setPostValues(array $postValues) {
+               $this->postValues = $postValues;
+       }
+
+       /**
+        * Status messages from controller
+        *
+        * @param array<\TYPO3\CMS\Install\Status\StatusInterface> $messages
+        */
+       public function setMessages(array $messages = array()) {
+               $this->messages = $messages;
+       }
+
+       /**
+        * Return TRUE if dbal and adodb extension is loaded
+        *
+        * @return boolean TRUE if dbal and adodb is loaded
+        */
+       protected function isDbalEnabled() {
+               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')
+                       && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')
+               ) {
+                       return TRUE;
+               }
+               return FALSE;
+       }
+
+       /**
+        * Context determines if the install tool is called within backend or standalone
+        *
+        * @return string Either 'standalone' or 'backend'
+        */
+       protected function getContext() {
+               $context = 'standalone';
+               $formValues = GeneralUtility::_GP('install');
+               if (isset($formValues['context'])) {
+                       $context = $formValues['context'] === 'backend' ? 'backend' : 'standalone';
+               }
+               return $context;
+       }
+
+       /**
+        * Get database instance.
+        * Will be initialized if it does not exist yet.
+        *
+        * @return \TYPO3\CMS\Core\Database\DatabaseConnection
+        */
+       protected function getDatabase() {
+               static $database;
+               if (!is_object($database)) {
+                       /** @var \TYPO3\CMS\Core\Database\DatabaseConnection $database */
+                       $database = $this->objectManager->get('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
+                       $database->setDatabaseUsername($GLOBALS['TYPO3_CONF_VARS']['DB']['username']);
+                       $database->setDatabasePassword($GLOBALS['TYPO3_CONF_VARS']['DB']['password']);
+                       $database->setDatabaseHost($GLOBALS['TYPO3_CONF_VARS']['DB']['host']);
+                       $database->setDatabasePort($GLOBALS['TYPO3_CONF_VARS']['DB']['port']);
+                       $database->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['database']);
+                       $database->connectDB();
+               }
+               return $database;
+       }
+
+       /**
+        * Some actions like the database analyzer and the upgrade wizards need additional
+        * bootstrap actions performed.
+        *
+        * Those actions can potentially fatal if some old extension is loaded that triggers
+        * a fatal in ext_localconf or ext_tables code! Use only if really needed.
+        *
+        * @return void
+        */
+       protected function loadExtLocalconfDatabaseAndExtTables() {
+               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+                       ->loadTypo3LoadedExtAndExtLocalconf(FALSE)
+                       ->applyAdditionalConfigurationSettings()
+                       ->initializeTypo3DbGlobal()
+                       ->loadExtensionTables(FALSE);
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/ActionInterface.php b/typo3/sysext/install/Classes/Controller/Action/ActionInterface.php
new file mode 100644 (file)
index 0000000..0b69ec0
--- /dev/null
@@ -0,0 +1,79 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * General action interface
+ */
+interface ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string rendered content
+        */
+       public function handle();
+
+       /**
+        * Set form protection token
+        *
+        * @param string $token Form protection token
+        * @return void
+        */
+       public function setToken($token);
+
+       /**
+        * Set controller, Either string 'step', 'tool' or 'common'
+        *
+        * @param string $controller Controller name
+        * @return void
+        */
+       public function setController($controller);
+
+       /**
+        * Set action name. This is usually similar to the class name,
+        * only for loginForm, the action is login
+        *
+        * @param string $action Name of target action for forms
+        * @return void
+        */
+       public function setAction($action);
+
+       /**
+        * Set POST values
+        *
+        * @param array $postValues List of values submitted via POST
+        * @return void
+        */
+       public function setPostValues(array $postValues);
+
+       /**
+        * Status messages from controller
+        *
+        * @param array<\TYPO3\CMS\Install\Status\StatusInterface> $messages
+        */
+       public function setMessages(array $messages = array());
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Common/InstallToolDisabledAction.php b/typo3/sysext/install/Classes/Controller/Action/Common/InstallToolDisabledAction.php
new file mode 100644 (file)
index 0000000..0dd05c2
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Common;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Welcome page
+ */
+class InstallToolDisabledAction extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+               return $this->view->render();
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Common/InstallToolPasswordNotSetAction.php b/typo3/sysext/install/Classes/Controller/Action/Common/InstallToolPasswordNotSetAction.php
new file mode 100644 (file)
index 0000000..00e96e0
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Common;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Welcome page
+ */
+class InstallToolPasswordNotSetAction extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+               return $this->view->render();
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Common/LoginForm.php b/typo3/sysext/install/Classes/Controller/Action/Common/LoginForm.php
new file mode 100644 (file)
index 0000000..9db3b4c
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Common;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Show login form
+ */
+class LoginForm extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+               $this->view->assign('messages', $this->messages);
+               return $this->view->render();
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseConnect.php
new file mode 100644 (file)
index 0000000..b43d60d
--- /dev/null
@@ -0,0 +1,491 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Database connect step:
+ * - Needs execution if database credentials are not set or fail to connect
+ * - Renders fields for database connection fields
+ * - Sets database credentials in LocalConfiguration
+ * - Loads / unloads ext:dbal and ext:adodb if requested
+ */
+class DatabaseConnect extends Action\AbstractAction implements StepInterface {
+
+       /**
+        * Execute database step:
+        * - Load / unload dbal & adodb
+        * - Set database connect credentials in LocalConfiguration
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute() {
+               $result = array();
+
+               /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+
+               $postValues = $this->postValues['values'];
+               if (isset($postValues['loadDbal'])) {
+                       $result[] = $this->executeLoadDbalExtension();
+               } elseif ($postValues['unloadDbal']) {
+                       $result[] = $this->executeUnloadDbalExtension();
+               } elseif ($postValues['setDbalDriver']) {
+                       $driver = $postValues['setDbalDriver'];
+                       switch ($driver) {
+                               case 'mssql':
+                               case 'odbc_mssql':
+                                       $driverConfig = array(
+                                               'useNameQuote' => TRUE,
+                                               'quoteClob' => FALSE,
+                                       );
+                                       break;
+                               case 'oci8':
+                                       $driverConfig = array(
+                                               'driverOptions' => array(
+                                                       'connectSID' => '',
+                                               ),
+                                       );
+                                       break;
+                       }
+                       $config = array(
+                               '_DEFAULT' => array(
+                                       'type' => 'adodb',
+                                       'config' => array(
+                                               'driver' => $driver,
+                                       )
+                               )
+                       );
+                       if (isset($driverConfig)) {
+                               $config['_DEFAULT']['config'] = array_merge($config['_DEFAULT']['config'], $driverConfig);
+                       }
+                       $configurationManager->setLocalConfigurationValueByPath('EXTCONF/dbal/handlerCfg', $config);
+               } else {
+                       $localConfigurationPathValuePairs = array();
+
+                       if ($this->isDbalEnabled()) {
+                               $config = $configurationManager->getConfigurationValueByPath('EXTCONF/dbal/handlerCfg');
+                               $driver = $config['_DEFAULT']['config']['driver'];
+                               if ($driver === 'oci8') {
+                                       $configurationManager['_DEFAULT']['config']['driverOptions']['connectSID']
+                                               = $postValues['type'] === 'sid' ? TRUE : FALSE;
+                               }
+                       }
+
+                       if (isset($postValues['username'])) {
+                               $value = $postValues['username'];
+                               if (strlen($value) <= 50) {
+                                       $localConfigurationPathValuePairs['DB/username'] = $value;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database username not valid');
+                                       $errorStatus->setMessage('Given username must be shorter than fifty characters.');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+
+                       if (isset($postValues['password'])) {
+                               $value = $postValues['password'];
+                               if (strlen($value) <= 50) {
+                                       $localConfigurationPathValuePairs['DB/password'] = $value;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database password not valid');
+                                       $errorStatus->setMessage('Given password must be shorter than fifty characters.');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+
+                       if (isset($postValues['host'])) {
+                               $value = $postValues['host'];
+                               if (preg_match('/^[a-zA-Z0-9_\\.-]+(:.+)?$/', $value) && strlen($value) <= 50) {
+                                       $localConfigurationPathValuePairs['DB/host'] = $value;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database host not valid');
+                                       $errorStatus->setMessage('Given host is not alphanumeric (a-z, A-Z, 0-9 or _-.:) or longer than fifty characters.');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+
+                       if (isset($postValues['port'])) {
+                               $value = $postValues['port'];
+                               if (preg_match('/^[0-9]+(:.+)?$/', $value) && $value > 0 && $value <= 65535) {
+                                       $localConfigurationPathValuePairs['DB/port'] = (int)$value;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database port not valid');
+                                       $errorStatus->setMessage('Given port is not numeric or within range 1 to 65535');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+
+                       if (isset($postValues['database'])) {
+                               $value = $postValues['database'];
+                               if (strlen($value) <= 50) {
+                                       $localConfigurationPathValuePairs['DB/database'] = $value;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database name not valid');
+                                       $errorStatus->setMessage('Given database name must be shorter than fifty characters.');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+
+                       if (!empty($localConfigurationPathValuePairs)) {
+                               $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
+
+                               // After setting new credentials, test again and create an error message if connect is not successful
+                               // @TODO: This could be simplified, if isConnectSuccessful could be released from TYPO3_CONF_VARS
+                               // and feeded with connect values directly in order to obsolete the bootstrap reload.
+                               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+                                       ->populateLocalConfiguration()
+                                       ->setCoreCacheToNullBackend();
+                               if ($this->isDbalEnabled()) {
+                                       require(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dbal') . 'ext_localconf.php');
+                                       $GLOBALS['typo3CacheManager']->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
+                               }
+                               if (!$this->isConnectSuccessful()) {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Database connect not successful');
+                                       $errorStatus->setMessage('Connecting the database with given settings failed. Please check.');
+                                       $result[] = $errorStatus;
+                               }
+                       }
+               }
+
+               return $result;
+       }
+
+       /**
+        * Step needs to be executed if database connection is not successful.
+        *
+        * @return boolean
+        */
+       public function needsExecution() {
+               if (!$this->isConnectSuccessful()) {
+                       return TRUE;
+               }
+               if (!isset($GLOBALS['TYPO3_CONF_VARS']['DB']['host'])
+                       || !isset($GLOBALS['TYPO3_CONF_VARS']['DB']['port'])
+               ) {
+                       return TRUE;
+               }
+               return FALSE;
+       }
+
+       /**
+        * Render this step
+        *
+        * @return string
+        */
+       public function handle() {
+               $this->initialize();
+
+               $isDbalEnabled = $this->isDbalEnabled();
+               $this->view
+                       ->assign('isDbalEnabled', $isDbalEnabled)
+                       ->assign('username', $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] ?: '')
+                       ->assign('password', $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] ?: '')
+                       ->assign('host', $this->getConfiguredHost() ?: '127.0.0.1')
+                       ->assign('port', $this->getConfiguredOrDefaultPort())
+                       ->assign('database', $GLOBALS['TYPO3_CONF_VARS']['DB']['database'] ?: '');
+
+               if ($isDbalEnabled) {
+                       $this->view->assign('selectedDbalDriver', $this->getSelectedDbalDriver());
+                       $this->view->assign('dbalDrivers', $this->getAvailableDbalDrivers());
+                       $this->setDbalInputFieldsToRender();
+               } else {
+                       $this->view
+                               ->assign('renderConnectDetailsUsername', TRUE)
+                               ->assign('renderConnectDetailsPassword', TRUE)
+                               ->assign('renderConnectDetailsHost', TRUE)
+                               ->assign('renderConnectDetailsPort', TRUE);
+               }
+
+               return $this->view->render();
+       }
+
+       /**
+        * Render fields required for successful connect based on dbal driver selection.
+        * Hint: There is a code duplication in handle() and this method. This
+        * is done by intention to keep this code area easy to maintain and understand.
+        *
+        * @return void
+        */
+       protected function setDbalInputFieldsToRender() {
+               $driver = $this->getSelectedDbalDriver();
+               switch($driver) {
+                       case 'mssql':
+                       case 'odbc_mssql':
+                       case 'postgres':
+                               $this->view
+                                       ->assign('renderConnectDetailsUsername', TRUE)
+                                       ->assign('renderConnectDetailsPassword', TRUE)
+                                       ->assign('renderConnectDetailsHost', TRUE)
+                                       ->assign('renderConnectDetailsPort', TRUE)
+                                       ->assign('renderConnectDetailsDatabase', TRUE);
+                               break;
+                       case 'oci8':
+                               $this->view
+                                       ->assign('renderConnectDetailsUsername', TRUE)
+                                       ->assign('renderConnectDetailsPassword', TRUE)
+                                       ->assign('renderConnectDetailsHost', TRUE)
+                                       ->assign('renderConnectDetailsPort', TRUE)
+                                       ->assign('renderConnectDetailsDatabase', TRUE)
+                                       ->assign('renderConnectDetailsOracleSidConnect', TRUE);
+                               $type = isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driverOptions']['connectSID'])
+                                       ? $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driverOptions']['connectSID']
+                                       : '';
+                               if ($type === TRUE) {
+                                       $this->view->assign('oracleSidSelected', TRUE);
+                               }
+                               break;
+               }
+       }
+
+       /**
+        * Render connect port and label
+        *
+        * @return integer Configured or default port
+        */
+       protected function getConfiguredOrDefaultPort() {
+               $configuredPort = (int)$this->getConfiguredPort();
+               if (!$configuredPort) {
+                       if ($this->isDbalEnabled()) {
+                               $driver = $this->getSelectedDbalDriver();
+                               switch ($driver) {
+                                       case 'postgres':
+                                               $port = 5432;
+                                               break;
+                                       case 'mssql':
+                                       case 'odbc_mssql':
+                                               $port = 1433;
+                                               break;
+                                       case 'oci8':
+                                               $port = 1521;
+                                               break;
+                                       default:
+                                               $port = 3306;
+                               }
+                       } else {
+                               $port = 3306;
+                       }
+               } else {
+                       $port = $configuredPort;
+               }
+               return $port;
+       }
+
+       /**
+        * Test connection with given credentials
+        *
+        * @return boolean TRUE if connect was successful
+        */
+       protected function isConnectSuccessful() {
+               /** @var $databaseConnection \TYPO3\CMS\Core\Database\DatabaseConnection */
+               $databaseConnection = $this->objectManager->get('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
+
+               if ($this->isDbalEnabled()) {
+                       // Set additional connect information based on dbal driver. postgres for example needs
+                       // database name already for connect.
+                       if (isset($GLOBALS['TYPO3_CONF_VARS']['DB']['database'])) {
+                               $databaseConnection->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['database']);
+                       }
+               }
+
+               $username = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['username']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] : '';
+               $databaseConnection->setDatabaseUsername($username);
+               $password = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['password']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] : '';
+               $databaseConnection->setDatabasePassword($password);
+               $databaseConnection->setDatabaseHost($this->getConfiguredHost());
+               $databaseConnection->setDatabasePort($this->getConfiguredPort());
+
+               $result = FALSE;
+               if (@$databaseConnection->sql_pconnect()) {
+                       $result = TRUE;
+               }
+               return $result;
+       }
+
+       /**
+        * Returns a list of database drivers that are available on current server.
+        *
+        * @return array
+        */
+       protected function getAvailableDbalDrivers() {
+               $supportedDrivers = $this->getSupportedDbalDrivers();
+               $availableDrivers = array();
+               $selectedDbalDriver = $this->getSelectedDbalDriver();
+               foreach ($supportedDrivers as $abstractionLayer => $drivers) {
+                       foreach ($drivers as $driver => $info) {
+                               if (isset($info['combine']) && $info['combine'] === 'OR') {
+                                       $isAvailable = FALSE;
+                               } else {
+                                       $isAvailable = TRUE;
+                               }
+                               // Loop through each PHP module dependency to ensure it is loaded
+                               foreach ($info['extensions'] as $extension) {
+                                       if (isset($info['combine']) && $info['combine'] === 'OR') {
+                                               $isAvailable |= extension_loaded($extension);
+                                       } else {
+                                               $isAvailable &= extension_loaded($extension);
+                                       }
+                               }
+                               if ($isAvailable) {
+                                       if (!isset($availableDrivers[$abstractionLayer])) {
+                                               $availableDrivers[$abstractionLayer] = array();
+                                       }
+                                       $availableDrivers[$abstractionLayer][$driver] = array();
+                                       $availableDrivers[$abstractionLayer][$driver]['driver'] = $driver;
+                                       $availableDrivers[$abstractionLayer][$driver]['label'] = $info['label'];
+                                       $availableDrivers[$abstractionLayer][$driver]['selected'] = FALSE;
+                                       if ($selectedDbalDriver === $driver) {
+                                               $availableDrivers[$abstractionLayer][$driver]['selected'] = TRUE;
+                                       }
+                               }
+                       }
+               }
+               return $availableDrivers;
+       }
+
+       /**
+        * Returns a list of DBAL supported database drivers, with a
+        * user-friendly name and any PHP module dependency.
+        *
+        * @return array
+        */
+       protected function getSupportedDbalDrivers() {
+               $supportedDrivers = array(
+                       'Native' => array(
+                               'mssql' => array(
+                                       'label' => 'Microsoft SQL Server',
+                                       'extensions' => array('mssql')
+                               ),
+                               'oci8' => array(
+                                       'label' => 'Oracle OCI8',
+                                       'extensions' => array('oci8')
+                               ),
+                               'postgres' => array(
+                                       'label' => 'PostgreSQL',
+                                       'extensions' => array('pgsql')
+                               )
+                       ),
+                       'ODBC' => array(
+                               'odbc_mssql' => array(
+                                       'label' => 'Microsoft SQL Server',
+                                       'extensions' => array('odbc', 'mssql')
+                               )
+                       )
+               );
+               return $supportedDrivers;
+       }
+
+       /**
+        * Get selected dbal driver if any
+        *
+        * @return string Dbal driver or empty string if not yet selected
+        */
+       protected function getSelectedDbalDriver() {
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driver'])) {
+                       return $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal']['handlerCfg']['_DEFAULT']['config']['driver'];
+               }
+               return '';
+       }
+
+       /**
+        * Adds dbal and adodb to list of loaded extensions
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function executeLoadDbalExtension() {
+               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')) {
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('adodb');
+               }
+               if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtension('dbal');
+               }
+               /** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
+               $warningStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
+               $warningStatus->setTitle('Loaded database abstraction layer');
+               return $warningStatus;
+       }
+
+       /**
+        * Remove dbal and adodb from list of loaded extensions
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function executeUnloadDbalExtension() {
+               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('adodb')) {
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension('adodb');
+               }
+               if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::unloadExtension('dbal');
+               }
+               // @TODO: Remove configuration from TYPO3_CONF_VARS['EXTCONF']['dbal']
+               /** @var $errorStatus \TYPO3\CMS\Install\Status\WarningStatus */
+               $warningStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
+               $warningStatus->setTitle('Removed database abstraction layer');
+               return $warningStatus;
+       }
+
+       /**
+        * Returns configured host with port split off if given
+        *
+        * @return string
+        */
+       protected function getConfiguredHost() {
+               $host = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['host']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] : '';
+               $port = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['port']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['port'] : '';
+               if (strlen($port) < 1 && strpos($host, ':') > 0) {
+                       list($host) = explode(':', $host);
+               }
+               return $host;
+       }
+
+       /**
+        * Returns configured port. Gets port from host value if port is not yet set.
+        *
+        * @return integer
+        */
+       protected function getConfiguredPort() {
+               $host = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['host']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] : '';
+               $port = isset($GLOBALS['TYPO3_CONF_VARS']['DB']['port']) ? $GLOBALS['TYPO3_CONF_VARS']['DB']['port'] : '';
+               if (!strlen($port) > 0 && strpos($host, ':') > 0) {
+                       $hostPortArray = explode(':', $host);
+                       $port = $hostPortArray[1];
+               }
+               return (int)$port;
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseData.php
new file mode 100644 (file)
index 0000000..643ebe6
--- /dev/null
@@ -0,0 +1,150 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Populate base tables, insert admin user, set install tool password
+ */
+class DatabaseData extends Action\AbstractAction implements StepInterface {
+
+       /**
+        * Import tables and data, create admin user, create install tool password
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute() {
+               $result = array();
+
+               /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+
+               $postValues = $this->postValues['values'];
+
+               // Check password and return early if not good enough
+               $password = $postValues['password'];
+               if (strlen($password) < 8) {
+                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $errorStatus->setTitle('Administrator password not good enough!');
+                       $errorStatus->setMessage(
+                               'You are setting an important password here! It gives an attacker full control over your instance if cracked.' .
+                               ' It should be strong (include lower and upper case characters, special characters and numbers) and must be at least eight characters long.'
+                       );
+                       $result[] = $errorStatus;
+                       return $result;
+               }
+
+               // Set site name
+               if (!empty($postValues['sitename'])) {
+                       $configurationManager->setLocalConfigurationValueByPath('SYS/sitename', $postValues['sitename']);
+               }
+
+               $this->importDatabaseData();
+
+               // Insert admin user
+               // Password is simple md5 here for now, will be updated by saltedpasswords on first login
+               // @TODO: Handle saltedpasswords in installer and store password salted in the first place
+               $adminUserFields = array(
+                       'username' => 'admin',
+                       'password' => md5($password),
+                       'admin' => 1,
+                       'tstamp' => $GLOBALS['EXEC_TIME'],
+                       'crdate' => $GLOBALS['EXEC_TIME']
+               );
+               $this->getDatabase()->exec_INSERTquery('be_users', $adminUserFields);
+
+               // Set password as install tool password
+               $configurationManager->setLocalConfigurationValueByPath('BE/installToolPassword', md5($password));
+
+               return $result;
+       }
+
+       /**
+        * Step needs to be executed if there are no tables in database
+        *
+        * @return boolean
+        */
+       public function needsExecution() {
+               $result = FALSE;
+               $existingTables = $this->getDatabase()->admin_get_tables();
+               if (count($existingTables) === 0) {
+                       $result = TRUE;
+               }
+               return $result;
+       }
+
+       /**
+        * Render this step
+        *
+        * @return string
+        */
+       public function handle() {
+               $this->initialize();
+               return $this->view->render();
+       }
+
+       /**
+        * Create tables and import static rows
+        *
+        * @return void
+        */
+       protected function importDatabaseData() {
+               // Will load ext_localconf and ext_tables. This is pretty safe here since we are
+               // in first install (database empty), so it is very likely that no extension is loaded
+               // that could trigger a fatal at this point.
+               $this->loadExtLocalconfDatabaseAndExtTables();
+
+               // Import database data
+               $database = $this->getDatabase();
+               /** @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService $schemaMigrationService */
+               $schemaMigrationService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
+               /** @var \TYPO3\CMS\Install\Service\SqlExpectedSchemaService $expectedSchemaService */
+               $expectedSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
+
+               // Raw concatenated ext_tables.sql and friends string
+               $expectedSchemaString = $expectedSchemaService->getTablesDefinitionString(TRUE);
+               $statements = $schemaMigrationService->getStatementArray($expectedSchemaString, TRUE);
+               list($_, $insertCount) = $schemaMigrationService->getCreateTables($statements, TRUE);
+
+               $fieldDefinitionsFile = $schemaMigrationService->getFieldDefinitions_fileContent($expectedSchemaString);
+               $fieldDefinitionsDatabase = $schemaMigrationService->getFieldDefinitions_database();
+               $difference = $schemaMigrationService->getDatabaseExtra($fieldDefinitionsFile, $fieldDefinitionsDatabase);
+               $updateStatements = $schemaMigrationService->getUpdateSuggestions($difference);
+
+               $schemaMigrationService->performUpdateQueries($updateStatements['add'], $updateStatements['add']);
+               $schemaMigrationService->performUpdateQueries($updateStatements['change'], $updateStatements['change']);
+               $schemaMigrationService->performUpdateQueries($updateStatements['create_table'], $updateStatements['create_table']);
+
+               foreach ($insertCount as $table => $count) {
+                       $insertStatements = $schemaMigrationService->getTableInsertStatements($statements, $table);
+                       foreach ($insertStatements as $insertQuery) {
+                               $insertQuery = rtrim($insertQuery, ';');
+                               $database->admin_query($insertQuery);
+                       }
+               }
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php b/typo3/sysext/install/Classes/Controller/Action/Step/DatabaseSelect.php
new file mode 100644 (file)
index 0000000..da4213c
--- /dev/null
@@ -0,0 +1,159 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Database select step.
+ * This step is only rendered if database is mysql. With dbal,
+ * database name is submitted by previous step already.
+ */
+class DatabaseSelect extends Action\AbstractAction implements StepInterface {
+
+       /**
+        * @var \TYPO3\CMS\Core\Database\DatabaseConnection
+        */
+       protected $databaseConnection = NULL;
+
+       /**
+        * Create database if needed, save selected db name in configuration
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute() {
+               $result = array();
+               $this->initializeDatabaseConnection();
+               $postValues = $this->postValues['values'];
+               $localConfigurationPathValuePairs = array();
+               if ($postValues['type'] === 'new') {
+                       $newDatabaseName = $postValues['new'];
+                       if (strlen($newDatabaseName) <= 50) {
+                               $createDatabaseResult = $this->databaseConnection->admin_query('CREATE DATABASE ' . $newDatabaseName . ' CHARACTER SET utf8');
+                               if ($createDatabaseResult) {
+                                       $localConfigurationPathValuePairs['DB/database'] = $newDatabaseName;
+                               } else {
+                                       /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                                       $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $errorStatus->setTitle('Unable to create database');
+                                       $errorStatus->setMessage(
+                                               'Database with name ' . $newDatabaseName . ' could not be created.' .
+                                               ' Either your database name contains special chars (only alphanumeric characters are allowed)' .
+                                               ' or your database user probably has no sufficient permissions to create it.' .
+                                               ' Please choose an existing (empty) database or contact administration.'
+                                       );
+                                       $result[] = $errorStatus;
+                               }
+                       } else {
+                               /** @var $errorStatus \TYPO3\CMS\Install\Status\ErrorStatus */
+                               $errorStatus = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $errorStatus->setTitle('Database name not valid');
+                               $errorStatus->setMessage('Given database name must be shorter than fifty characters.');
+                               $result[] = $errorStatus;
+                       }
+               } elseif ($postValues['type'] === 'existing') {
+                       $localConfigurationPathValuePairs['DB/database'] = $postValues['existing'];
+               }
+
+               if (!empty($localConfigurationPathValuePairs)) {
+                       /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
+                       $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                       $configurationManager->setLocalConfigurationValuesByPathValuePairs($localConfigurationPathValuePairs);
+               }
+
+               return $result;
+       }
+
+       /**
+        * Step needs to be executed if database is not set or can
+        * not be selected.
+        *
+        * @return boolean
+        */
+       public function needsExecution() {
+               $this->initializeDatabaseConnection();
+               $result = TRUE;
+               if (strlen($GLOBALS['TYPO3_CONF_VARS']['DB']['database']) > 0) {
+                       $this->databaseConnection->setDatabaseName($GLOBALS['TYPO3_CONF_VARS']['DB']['database']);
+                       try {
+                               $selectResult = $this->databaseConnection->sql_select_db();
+                               if ($selectResult === TRUE) {
+                                       $result = FALSE;
+                               }
+                       } catch (\RuntimeException $e) {
+                       }
+               }
+               return $result;
+       }
+
+       /**
+        * Render this step
+        *
+        * @return string
+        */
+       public function handle() {
+               $this->initialize();
+               $this->view->assign('databaseList', $this->getDatabaseList());
+               return $this->view->render();
+       }
+
+       /**
+        * Returns list of available databases (with access-check based on username/password)
+        *
+        * @return array List of available databases
+        */
+       protected function getDatabaseList() {
+               $this->initializeDatabaseConnection();
+               $databaseArray = $this->databaseConnection->admin_get_dbs();
+               // Remove mysql organizational tables from database list
+               $reservedDatabaseNames = array('mysql', 'information_schema', 'performance_schema');
+               $allPossibleDatabases = array_diff($databaseArray, $reservedDatabaseNames);
+               $databasesWithoutTables = array();
+               foreach ($allPossibleDatabases as $database) {
+                       $this->databaseConnection->setDatabaseName($database);
+                       $this->databaseConnection->sql_select_db();
+                       $existingTables = $this->databaseConnection->admin_get_tables();
+                       if (count($existingTables) === 0) {
+                               $databasesWithoutTables[] = $database;
+                       }
+               }
+               return $databasesWithoutTables;
+       }
+
+       /**
+        * Initialize database connection
+        *
+        * @return void
+        */
+       protected function initializeDatabaseConnection() {
+               $this->databaseConnection = $this->objectManager->get('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
+               $this->databaseConnection->setDatabaseUsername($GLOBALS['TYPO3_CONF_VARS']['DB']['username']);
+               $this->databaseConnection->setDatabasePassword($GLOBALS['TYPO3_CONF_VARS']['DB']['password']);
+               $this->databaseConnection->setDatabaseHost($GLOBALS['TYPO3_CONF_VARS']['DB']['host']);
+               $this->databaseConnection->setDatabasePort($GLOBALS['TYPO3_CONF_VARS']['DB']['port']);
+               $this->databaseConnection->sql_pconnect();
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php b/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php
new file mode 100644 (file)
index 0000000..a26bded
--- /dev/null
@@ -0,0 +1,90 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Set production defaults
+ */
+class DefaultConfiguration extends Action\AbstractAction implements StepInterface {
+
+       /**
+        * Set defaults of auto configuration, mark installation as completed
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute() {
+               // @TODO: Implement "auto configuration"
+
+               /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+               $configurationManager->setLocalConfigurationValueByPath('SYS/isInitialInstallationInProgress', FALSE);
+
+               /** @var \TYPO3\CMS\Install\Service\SessionService $session */
+               $session = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SessionService');
+               $session->destroySession();
+
+               /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
+               $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
+                       'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection'
+               );
+               $formProtection->clean();
+
+               // @TODO: This and similar code in ToolController should be moved to enable install file service
+               $enableInstallToolFile = PATH_site . 'typo3conf/ENABLE_INSTALL_TOOL';
+               if (is_file($enableInstallToolFile) && trim(file_get_contents($enableInstallToolFile)) !== 'KEEP_FILE') {
+                       unlink($enableInstallToolFile);
+               }
+
+               \TYPO3\CMS\Core\Utility\HttpUtility::redirect('../../../index.php', \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_303);
+       }
+
+       /**
+        * Step needs to be executed if 'isInitialInstallationInProgress' is set to TRUE in LocalConfiguration
+        *
+        * @return boolean
+        */
+       public function needsExecution() {
+               $result = FALSE;
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['isInitialInstallationInProgress'])
+                       && $GLOBALS['TYPO3_CONF_VARS']['SYS']['isInitialInstallationInProgress'] === TRUE
+               ) {
+                       $result = TRUE;
+               }
+               return $result;
+       }
+
+       /**
+        * Render this step
+        *
+        * @return string
+        */
+       public function handle() {
+               $this->initialize();
+               return $this->view->render();
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php b/typo3/sysext/install/Classes/Controller/Action/Step/EnvironmentAndFolders.php
new file mode 100644 (file)
index 0000000..9eed07c
--- /dev/null
@@ -0,0 +1,117 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Very first install step:
+ * - Needs execution if typo3conf/LocalConfiguration.php does not exist
+ * - Renders system environment output
+ * - Creates folders like typo3temp, see FolderStructure/DefaultFactory for details
+ * - Creates typo3conf/LocalConfiguration.php from factory
+ */
+class EnvironmentAndFolders extends Action\AbstractAction implements StepInterface {
+
+       /**
+        * Execute environment and folder step:
+        * - Create main folder structure
+        * - Create typo3conf/LocalConfiguration.php
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute() {
+               /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
+               $folderStructureFactory = $this->objectManager->get('TYPO3\\CMS\\Install\\FolderStructure\\DefaultFactory');
+               /** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
+               $structureFacade = $folderStructureFactory->getStructure();
+               $structureFixMessages = $structureFacade->fix();
+               /** @var \TYPO3\CMS\Install\Status\StatusUtility $statusUtility */
+               $statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
+               $errorsFromStructure = $statusUtility->filterBySeverity($structureFixMessages, 'error');
+
+               // Proceed with creating LocalConfiguration.php only if folder creation did not throw errors
+               if (empty($errorsFromStructure)) {
+                       /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+                       $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                       $configurationManager->createLocalConfigurationFromFactoryConfiguration();
+
+                       // Create enable install tool file after typo3conf & LocalConfiguration were created
+                       $installToolService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\EnableFileService');
+                       $installToolService->createInstallToolEnableFile();
+               }
+
+               return $errorsFromStructure;
+       }
+
+       /**
+        * Step needs to be executed if LocalConfiguration file does not exist.
+        *
+        * @return boolean
+        */
+       public function needsExecution() {
+               if (@is_file(PATH_typo3conf . 'LocalConfiguration.php')) {
+                       return FALSE;
+               } else {
+                       return TRUE;
+               }
+       }
+
+       /**
+        * Render this step
+        *
+        * @return string
+        */
+       public function handle() {
+               $this->initialize();
+
+               /** @var \TYPO3\CMS\Install\SystemEnvironment\Check $statusCheck */
+               $statusCheck = $this->objectManager->get('TYPO3\\CMS\\Install\\SystemEnvironment\\Check');
+               $statusObjects = $statusCheck->getStatus();
+               /** @var \TYPO3\CMS\Install\Status\StatusUtility $statusUtility */
+               $statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
+               $environmentStatus = $statusUtility->sortBySeverity($statusObjects);
+               $this->view->assign('environmentStatus', $environmentStatus);
+
+               /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
+               $folderStructureFactory = $this->objectManager->get('TYPO3\\CMS\\Install\\FolderStructure\\DefaultFactory');
+               /** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
+               $structureFacade = $folderStructureFactory->getStructure();
+               $structureMessages = $structureFacade->getStatus();
+               /** @var $statusUtility \TYPO3\CMS\Install\Status\StatusUtility */
+               $structureErrors = $statusUtility->filterBySeverity($structureMessages, 'error');
+               $this->view->assign('structureErrors', $structureErrors);
+
+               if (count($environmentStatus['error']) > 0
+                       || count($environmentStatus['warning']) > 0
+                       || count($structureErrors) > 0
+               ) {
+                       $this->view->assign('errorsOrWarningsFromStatus', TRUE);
+               }
+
+               return $this->view->render();
+       }
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php b/typo3/sysext/install/Classes/Controller/Action/Step/StepInterface.php
new file mode 100644 (file)
index 0000000..370e98e
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Step;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Interface implemented by single steps
+ */
+interface StepInterface extends Action\ActionInterface {
+
+       /**
+        * Execute a step
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       public function execute();
+
+       /**
+        * Whether this step must be executed
+        *
+        * @return boolean TRUE if this step needs to be executed
+        */
+       public function needsExecution();
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php b/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php
new file mode 100644 (file)
index 0000000..fdba2ba
--- /dev/null
@@ -0,0 +1,193 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Tool;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Show system environment check results
+ */
+class AllConfiguration extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+
+               if (isset($this->postValues['set']['write'])) {
+                       $this->view->assign('configurationValuesSaved', TRUE);
+                       $this->view->assign('savedConfigurationValueMessages', $this->updateLocalConfigurationValues());
+               } else {
+                       $this->view->assign('data', $this->setUpConfigurationData());
+               }
+
+               return $this->view->render();
+       }
+
+       /**
+        * Set up configuration data
+        *
+        * @return array Configuration data
+        */
+       protected function setUpConfigurationData() {
+               $data = array();
+               foreach ($GLOBALS['TYPO3_CONF_VARS'] as $sectionName => $sectionData) {
+                       $data[$sectionName] = array();
+
+                       foreach ($sectionData as $key => $value) {
+                               if (isset($GLOBALS['TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key])) {
+                                       // Don't allow editing stuff which is added by extensions
+                                       // Make sure we fix potentially duplicated entries from older setups
+                                       $potentialValue = str_replace(array('\'.chr(10).\'', '\' . LF . \''), array(LF, LF), $value);
+                                       while (preg_match('/' . preg_quote($GLOBALS['TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key], '/') . '$/', '', $potentialValue)) {
+                                               $potentialValue = preg_replace('/' . preg_quote($GLOBALS['TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key], '/') . '$/', '', $potentialValue);
+                                       }
+                                       $value = $potentialValue;
+                               }
+
+                               $commentArray = $this->getDefaultConfigArrayComments();
+                               $description = trim($commentArray[$sectionName][$key]);
+                               $isTextarea = preg_match('/^(<.*?>)?string \\(textarea\\)/i', $description) ? TRUE : FALSE;
+                               $doNotRender = preg_match('/^(<.*?>)?string \\(exclude\\)/i', $description) ? TRUE : FALSE;
+
+                               if (!is_array($value) && !$doNotRender && (!preg_match('/[' . LF . CR . ']/', $value) || $isTextarea)) {
+                                       $itemData = array();
+                                       $itemData['key'] = $key;
+                                       $itemData['description'] = $description;
+                                       if ($isTextarea) {
+                                               $itemData['type'] = 'textarea';
+                                               $itemData['value'] = str_replace(array('\'.chr(10).\'', '\' . LF . \''), array(LF, LF), $value);
+                                       } elseif (preg_match('/^(<.*?>)?boolean/i', $description)) {
+                                               $itemData['type'] = 'checkbox';
+                                               $itemData['value'] = $value && strcmp($value, '0') ? $value : 1;
+                                               $itemData['checked'] = $value ? TRUE : FALSE;
+                                       } else {
+                                               $itemData['type'] = 'input';
+                                               $itemData['value'] = $value;
+                                       }
+                                       $data[$sectionName][] = $itemData;
+                               }
+                       }
+               }
+               return $data;
+       }
+
+       /**
+        * Store changed values in LocalConfiguration
+        *
+        * @return string Status messages of changed values
+        */
+       protected function updateLocalConfigurationValues() {
+               $statusObjects = array();
+               if (isset($this->postValues['values']) && is_array($this->postValues['values'])) {
+                       $configurationPathValuePairs = array();
+                       $commentArray = $this->getDefaultConfigArrayComments();
+                       $formValues = $this->postValues['values'];
+                       foreach ($formValues as $section => $valueArray) {
+                               if (is_array($GLOBALS['TYPO3_CONF_VARS'][$section])) {
+                                       foreach ($valueArray as $valueKey => $value) {
+                                               if (isset($GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey])) {
+                                                       $description = trim($commentArray[$section][$valueKey]);
+                                                       if (preg_match('/^string \\(textarea\\)/i', $description)) {
+                                                               // Force Unix linebreaks in textareas
+                                                               $value = str_replace(CR, '', $value);
+                                                               // Preserve linebreaks
+                                                               $value = str_replace(LF, '\' . LF . \'', $value);
+                                                       }
+                                                       if (preg_match('/^boolean/i', $description)) {
+                                                               // When submitting settings in the Install Tool, values that default to "FALSE" or "TRUE"
+                                                               // in EXT:core/Configuration/DefaultConfiguration.php will be sent as "0" resp. "1".
+                                                               // Therefore, reset the values to their boolean equivalent.
+                                                               if ($GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey] === FALSE && $value === '0') {
+                                                                       $value = FALSE;
+                                                               } elseif ($GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey] === TRUE && $value === '1') {
+                                                                       $value = TRUE;
+                                                               }
+                                                       }
+                                                       // Save if value changed
+                                                       if (strcmp($GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey], $value)) {
+                                                               $configurationPathValuePairs[$section . '/' . $valueKey] = $value;
+                                                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                                                               $status = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                                                               $status->setTitle('$TYPO3_CONF_VARS[\'' . $section . '\'][\'' . $valueKey . '\']');
+                                                               $status->setMessage('New value = ' . $value);
+                                                               $statusObjects[] = $status;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       if (count($statusObjects)) {
+                               /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+                               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                               $configurationManager->setLocalConfigurationValuesByPathValuePairs($configurationPathValuePairs);
+                       }
+               }
+               return $statusObjects;
+       }
+
+       /**
+        * Make an array of the comments in the EXT:core/Configuration/DefaultConfiguration.php file
+        *
+        * @return array
+        */
+       protected function getDefaultConfigArrayComments() {
+               /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+               $string = GeneralUtility::getUrl($configurationManager->getDefaultConfigurationFileLocation());
+
+               $commentArray = array();
+               $lines = explode(LF, $string);
+               $in = 0;
+               $mainKey = '';
+               foreach ($lines as $lc) {
+                       $lc = trim($lc);
+                       if ($in) {
+                               if (!strcmp($lc, ');')) {
+                                       $in = 0;
+                               } else {
+                                       if (preg_match('/["\']([[:alnum:]_-]*)["\'][[:space:]]*=>(.*)/i', $lc, $reg)) {
+                                               preg_match('/,[\\t\\s]*\\/\\/(.*)/i', $reg[2], $creg);
+                                               $theComment = trim($creg[1]);
+                                               if (substr(strtolower(trim($reg[2])), 0, 5) == 'array' && !strcmp($reg[1], strtoupper($reg[1]))) {
+                                                       $mainKey = trim($reg[1]);
+                                               } elseif ($mainKey) {
+                                                       $commentArray[$mainKey][$reg[1]] = $theComment;
+                                               }
+                                       }
+                               }
+                       }
+                       if (!strcmp($lc, 'return array(')) {
+                               $in = 1;
+                       }
+               }
+               return $commentArray;
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/CleanUp.php b/typo3/sysext/install/Classes/Controller/Action/Tool/CleanUp.php
new file mode 100644 (file)
index 0000000..5519cee
--- /dev/null
@@ -0,0 +1,285 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Tool;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Clean up page
+ */
+class CleanUp extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Status messages of submitted actions
+        *
+        * @var array
+        */
+       protected $actionMessages = array();
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+
+               if (isset($this->postValues['set']['clearTables'])) {
+                       $this->actionMessages[] = $this->clearSelectedTables();
+               }
+               if (isset($this->postValues['set']['resetBackendUserUc'])) {
+                       $this->actionMessages[] = $this->resetBackendUserUc();
+               }
+
+               $this->view->assign('cleanableTables', $this->getCleanableTableList());
+
+               $typo3TempData = $this->getTypo3TempStatistics();
+               $this->view->assign('typo3TempData', $typo3TempData);
+
+               $this->view->assign('actionMessages', $this->actionMessages);
+               return $this->view->render();
+       }
+
+       /**
+        * Get list of existing tables that could be truncated.
+        *
+        * @return array List of cleanable tables with name, description and number of rows
+        */
+       protected function getCleanableTableList() {
+               $tableCandidates = array(
+                       array(
+                               'name' => 'be_sessions',
+                               'description' => 'Backend user sessions'
+                       ),
+                       array(
+                               'name' => 'cache_imagesizes',
+                               'description' => 'Cached image sizes',
+                       ),
+                       array(
+                               'name' => 'cache_md5params',
+                               'description' => 'Frontend redirects',
+                       ),
+                       array(
+                               'name' => 'cache_typo3temp_log',
+                               'description' => 'Image rendering lock information',
+                       ),
+                       array(
+                               'name' => 'fe_sessions',
+                               'description' => 'Frontend user sessions',
+                       ),
+                       array(
+                               'name' => 'fe_session_data',
+                               'description' => 'Frontend user session data',
+                       ),
+                       array(
+                               'name' => 'sys_history',
+                               'description' => 'Tracking of database record changes through TYPO3 backend forms',
+                       ),
+                       array(
+                               'name' => 'sys_lockedrecords',
+                               'description' => 'Record locking of backend user editing',
+                       ),
+                       array(
+                               'name' => 'sys_log',
+                               'description' => 'General log table',
+                       ),
+                       array(
+                               'name' => 'sys_preview',
+                               'description' => 'Workspace preview links',
+                       ),
+                       array(
+                               'name' => 'tx_extensionmanager_domain_model_extension',
+                               'description' => 'List of TER extensions',
+                       ),
+                       array(
+                               'name' => 'tx_rsaauth_keys',
+                               'description' => 'Login process key storage'
+                       ),
+               );
+               $database = $this->getDatabase();
+               $allTables = array_keys($database->admin_get_tables());
+               $tables = array();
+               foreach ($tableCandidates as $candidate) {
+                       if (in_array($candidate['name'], $allTables)) {
+                               $candidate['rows'] = $database->exec_SELECTcountRows('*', $candidate['name']);
+                               $tables[] = $candidate;
+                       }
+               }
+               return $tables;
+       }
+
+       /**
+        * Truncate selected tables
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function clearSelectedTables() {
+               $clearedTables = array();
+               $database = $this->getDatabase();
+               foreach ($this->postValues['values'] as $tableName => $selected) {
+                       if ($selected == 1) {
+                               $database->exec_TRUNCATEquery($tableName);
+                               $clearedTables[] = $tableName;
+                       }
+               }
+               if (count($clearedTables)) {
+                       /** @var \TYPO3\CMS\Install\Status\OkStatus $message */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                       $message->setTitle('Cleared tables');
+                       $message->setMessage('List of cleared tables: ' . implode(', ', $clearedTables));
+               } else {
+                       /** @var \TYPO3\CMS\Install\Status\OkStatus $message */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\InfoStatus');
+                       $message->setTitle('No tables selected to clear');
+               }
+               return $message;
+       }
+
+       /**
+        * Reset uc field of all be_users to empty string
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function resetBackendUserUc() {
+               $database = $this->getDatabase();
+               $database->exec_UPDATEquery('be_users', '', array('uc' => ''));
+               /** @var \TYPO3\CMS\Install\Status\OkStatus $message */
+               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+               $message->setTitle('Reset all backend users preferences');
+               return $message;
+       }
+
+       /**
+        * Data for the typo3temp/ deletion view
+        *
+        * @return array Data array
+        */
+       protected function getTypo3TempStatistics() {
+               $data = array();
+               $pathTypo3Temp= PATH_site . 'typo3temp/';
+               $postValues = $this->postValues['values'];
+
+               $condition = '0';
+               if (isset($postValues['condition'])) {
+                       $condition = $postValues['condition'];
+               }
+               $numberOfFilesToDelete = 0;
+               if (isset($postValues['numberOfFiles'])) {
+                       $numberOfFilesToDelete = $postValues['numberOfFiles'];
+               }
+               $subDirectory = '';
+               if (isset($postValues['subDirectory'])) {
+                       $subDirectory = $postValues['subDirectory'];
+               }
+
+               // Run through files
+               $fileCounter = 0;
+               $deleteCounter = 0;
+               $criteriaMatch = 0;
+               $timeMap = array('day' => 1, 'week' => 7, 'month' => 30);
+               $directory = @dir($pathTypo3Temp . $subDirectory);
+               if (is_object($directory)) {
+                       while ($entry = $directory->read()) {
+                               $absoluteFile = $pathTypo3Temp . $subDirectory . '/' . $entry;
+                               if (@is_file($absoluteFile)) {
+                                       $ok = FALSE;
+                                       $fileCounter++;
+                                       if ($condition) {
+                                               if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($condition)) {
+                                                       if (filesize($absoluteFile) > $condition * 1024) {
+                                                               $ok = TRUE;
+                                                       }
+                                               } else {
+                                                       if (fileatime($absoluteFile) < $GLOBALS['EXEC_TIME'] - intval($timeMap[$condition]) * 60 * 60 * 24) {
+                                                               $ok = TRUE;
+                                                       }
+                                               }
+                                       } else {
+                                               $ok = TRUE;
+                                       }
+                                       if ($ok) {
+                                               $hashPart = substr(basename($absoluteFile), -14, 10);
+                                               // This is a kind of check that the file being deleted has a 10 char hash in it
+                                               if (
+                                                       !preg_match('/[^a-f0-9]/', $hashPart)
+                                                       || substr($absoluteFile, -6) === '.cache'
+                                                       || substr($absoluteFile, -4) === '.tbl'
+                                                       || substr($absoluteFile, -4) === '.css'
+                                                       || substr($absoluteFile, -3) === '.js'
+                                                       || substr($absoluteFile, -5) === '.gzip'
+                                                       || substr(basename($absoluteFile), 0, 8) === 'installTool'
+                                               ) {
+                                                       if ($numberOfFilesToDelete && $deleteCounter < $numberOfFilesToDelete) {
+                                                               $deleteCounter++;
+                                                               unlink($absoluteFile);
+                                                       } else {
+                                                               $criteriaMatch++;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+                       $directory->close();
+               }
+               $data['numberOfFilesMatchingCriteria'] = $criteriaMatch;
+               $data['numberOfDeletedFiles'] = $deleteCounter;
+
+               if ($deleteCounter > 0) {
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                       $message->setTitle('Deleted ' . $deleteCounter . ' files from typo3temp/' . $subDirectory . '/');
+                       $this->actionMessages[] = $message;
+               }
+
+               $data['selectedCondition'] = $condition;
+               $data['numberOfFiles'] = $numberOfFilesToDelete;
+               $data['selectedSubDirectory'] = $subDirectory;
+
+               // Set up sub directory data
+               $data['subDirectories'] = array(
+                       '' => array(
+                               'name' => '',
+                               'filesNumber' => count(GeneralUtility::getFilesInDir($pathTypo3Temp)),
+                       ),
+               );
+               $directories = dir($pathTypo3Temp);
+               if (is_object($directories)) {
+                       while ($entry = $directories->read()) {
+                               if (is_dir($pathTypo3Temp . $entry) && $entry != '..' && $entry != '.') {
+                                       $data['subDirectories'][$entry]['name'] = $entry;
+                                       $data['subDirectories'][$entry]['filesNumber'] = count(GeneralUtility::getFilesInDir($pathTypo3Temp . $entry));
+                                       $data['subDirectories'][$entry]['selected'] = FALSE;
+                                       if ($entry === $data['selectedSubDirectory']) {
+                                               $data['subDirectories'][$entry]['selected'] = TRUE;
+                                       }
+                               }
+                       }
+               }
+               $data['numberOfFilesInSelectedDirectory'] = $data['subDirectories'][$data['selectedSubDirectory']]['filesNumber'];
+
+               return $data;
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/FolderStructure.php b/typo3/sysext/install/Classes/Controller/Action/Tool/FolderStructure.php
new file mode 100644 (file)
index 0000000..ed4c00a
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Tool;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+
+/**
+ * Handle folder structure
+ */
+class FolderStructure extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+
+               /** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
+               $folderStructureFactory = $this->objectManager->get('TYPO3\\CMS\\Install\\FolderStructure\\DefaultFactory');
+               /** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
+               $structureFacade = $folderStructureFactory->getStructure();
+
+               $fixedStatusObjects = array();
+               if (isset($this->postValues['set']['fix'])) {
+                       $fixedStatusObjects = $structureFacade->fix();
+               }
+
+               $statusObjects = $structureFacade->getStatus();
+               /** @var $statusUtility \TYPO3\CMS\Install\Status\StatusUtility */
+               $statusUtility = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\StatusUtility');
+
+               $this->view
+                       ->assign('fixedStatus', $fixedStatusObjects)
+                       ->assign('notFixableStatus', $statusUtility->filterBySeverity($statusObjects, 'error'))
+                       ->assign('fixableStatus', $statusUtility->filterBySeverity($statusObjects, 'warning'))
+                       ->assign('okStatus', $statusUtility->filterBySeverity($statusObjects, 'ok'));
+
+               return $this->view->render();
+       }
+}
+?>
diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php b/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php
new file mode 100644 (file)
index 0000000..2f5df93
--- /dev/null
@@ -0,0 +1,390 @@
+<?php
+namespace TYPO3\CMS\Install\Controller\Action\Tool;
+
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2013 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+use TYPO3\CMS\Install\Controller\Action;
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+
+/**
+ * Handle important actions
+ */
+class ImportantActions extends Action\AbstractAction implements Action\ActionInterface {
+
+       /**
+        * Handle this action
+        *
+        * @return string content
+        */
+       public function handle() {
+               $this->initialize();
+
+               if (isset($this->postValues['set']['changeEncryptionKey'])) {
+                       $this->setNewEncryptionKeyAndLogOut();
+               }
+
+               $actionMessages = array();
+               if (isset($this->postValues['set']['changeInstallToolPassword'])) {
+                       $actionMessages[] = $this->changeInstallToolPassword();
+               }
+               if (isset($this->postValues['set']['changeSiteName'])) {
+                       $actionMessages[] = $this->changeSiteName();
+               }
+               if (isset($this->postValues['set']['createAdministrator'])) {
+                       $actionMessages[] = $this->createAdministrator();
+               }
+
+               // Database analyzer handling
+               if (isset($this->postValues['set']['databaseAnalyzerExecute'])
+                       || isset($this->postValues['set']['databaseAnalyzerAnalyze'])
+               ) {
+                       $this->loadExtLocalconfDatabaseAndExtTables();
+               }
+               if (isset($this->postValues['set']['databaseAnalyzerExecute'])) {
+                       $actionMessages = array_merge($actionMessages, $this->databaseAnalyzerExecute());
+               }
+               if (isset($this->postValues['set']['databaseAnalyzerAnalyze'])) {
+                       $actionMessages[] = $this->databaseAnalyzerAnalyze();
+               }
+
+               $this->view->assign('actionMessages', $actionMessages);
+
+               $operatingSystem = TYPO3_OS === 'WIN' ? 'Windows' : 'Unix';
+               $cgiDetected = (PHP_SAPI == 'fpm-fcgi' || PHP_SAPI == 'cgi' || PHP_SAPI == 'isapi' || PHP_SAPI == 'cgi-fcgi')
+                       ? TRUE
+                       : FALSE;
+
+               $this->view
+                       ->assign('operatingSystem', $operatingSystem)
+                       ->assign('cgiDetected', $cgiDetected)
+                       ->assign('databaseName', $GLOBALS['TYPO3_CONF_VARS']['DB']['database'])
+                       ->assign('databaseUsername', $GLOBALS['TYPO3_CONF_VARS']['DB']['username'])
+                       ->assign('databaseHost', $GLOBALS['TYPO3_CONF_VARS']['DB']['host'])
+                       ->assign('databasePort', $GLOBALS['TYPO3_CONF_VARS']['DB']['port'])
+                       ->assign('databaseNumberOfTables', count($this->getDatabase()->admin_get_tables()));
+
+               return $this->view->render();
+       }
+
+       /**
+        * Set new password if requested
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function changeInstallToolPassword() {
+               $values = $this->postValues['values'];
+               if ($values['newInstallToolPassword'] !== $values['newInstallToolPasswordCheck']) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Install tool password not changed');
+                       $message->setMessage('Given passwords do not match.');
+               } elseif (strlen($values['newInstallToolPassword']) < 8) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Install tool password not changed');
+                       $message->setMessage('Given passwords must be a least eight characters long.');
+               } else {
+                       /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+                       $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                       $configurationManager->setLocalConfigurationValueByPath('BE/installToolPassword', md5($values['newInstallToolPassword']));
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                       $message->setTitle('Install tool password changed');
+               }
+               return $message;
+       }
+
+       /**
+        * Set new site name
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function changeSiteName() {
+               $values = $this->postValues['values'];
+               if (isset($values['newSiteName']) && strlen($values['newSiteName']) > 0) {
+                       /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+                       $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+                       $configurationManager->setLocalConfigurationValueByPath('SYS/sitename', $values['newSiteName']);
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                       $message->setTitle('Site name changed');
+                       $this->view->assign('siteName', $values['newSiteName']);
+               } else {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Site name not changed');
+                       $message->setMessage('Site name must be at least one character long.');
+               }
+               return $message;
+       }
+
+       /**
+        * Set new encryption key
+        *
+        * @return void
+        */
+       protected function setNewEncryptionKeyAndLogOut() {
+               $newKey = \TYPO3\CMS\Core\Utility\GeneralUtility::getRandomHexString(96);
+               /** @var \TYPO3\CMS\Core\Configuration\ConfigurationManager $configurationManager */
+               $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager');
+               $configurationManager->setLocalConfigurationValueByPath('SYS/encryptionKey', $newKey);
+               /** @var $formProtection \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection */
+               $formProtection = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get(
+                       'TYPO3\\CMS\\Core\\FormProtection\\InstallToolFormProtection'
+               );
+               $formProtection->clean();
+               /** @var \TYPO3\CMS\Install\Service\SessionService $session */
+               $session = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SessionService');
+               $session->destroySession();
+               \TYPO3\CMS\Core\Utility\HttpUtility::redirect('Install.php?install[context]=' . $this->getContext());
+       }
+
+       /**
+        * Create administrator user
+        *
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function createAdministrator() {
+               $values = $this->postValues['values'];
+               $username = preg_replace('/[^\\da-z._]/i', '', trim($values['newUserUsername']));
+               $password = $values['newUserPassword'];
+               $passwordCheck = $values['newUserPasswordCheck'];
+
+               if (strlen($username) < 1) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Administrator user not created');
+                       $message->setMessage('No valid username given.');
+               } elseif ($password !== $passwordCheck) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Administrator user not created');
+                       $message->setMessage('Passwords do not match.');
+               } elseif (strlen($password) < 8) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                       $message->setTitle('Administrator user not created');
+                       $message->setMessage('Password must be at least eight characters long.');
+               } else {
+                       $database = $this->getDatabase();
+                       $userExists = $database->exec_SELECTcountRows(
+                               'uid',
+                               'be_users',
+                               'username=' . $database->fullQuoteStr($username, 'be_users')
+                       );
+                       if ($userExists) {
+                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                               $message->setTitle('Administrator user not created');
+                               $message->setMessage('A user with username ' . $username . ' exists already.');
+                       } else {
+                               // @TODO: Handle saltedpasswords in installer and store password salted in the first place
+                               $adminUserFields = array(
+                                       'username' => $username,
+                                       'password' => md5($password),
+                                       'admin' => 1,
+                                       'tstamp' => $GLOBALS['EXEC_TIME'],
+                                       'crdate' => $GLOBALS['EXEC_TIME']
+                               );
+                               $database->exec_INSERTquery('be_users', $adminUserFields);
+                               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+                               $message->setTitle('Administrator created');
+                       }
+               }
+
+               return $message;
+       }
+
+       /**
+        * Execute database migration
+        *
+        * @return array<\TYPO3\CMS\Install\Status\StatusInterface>
+        */
+       protected function databaseAnalyzerExecute() {
+               $messages = array();
+
+               // Early return in case no updade was selected
+               if (empty($this->postValues['values'])) {
+                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\WarningStatus');
+                       $message->setTitle('No database changes selected');
+                       $messages[] = $message;
+                       return $message;
+               }
+
+               /** @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService $schemaMigrationService */
+               $schemaMigrationService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
+               /** @var \TYPO3\CMS\Install\Service\SqlExpectedSchemaService $expectedSchemaService */
+               $expectedSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
+               $expectedSchema = $expectedSchemaService->getExpectedDatabaseSchema();
+               $currentSchema = $schemaMigrationService->getFieldDefinitions_database();
+
+               $statementHashesToPerform = $this->postValues['values'];
+
+               $results = array();
+
+               // Difference from expected to current
+               $addCreateChange = $schemaMigrationService->getDatabaseExtra($expectedSchema, $currentSchema);
+               $addCreateChange = $schemaMigrationService->getUpdateSuggestions($addCreateChange);
+               $results[] = $schemaMigrationService->performUpdateQueries($addCreateChange['add'], $statementHashesToPerform);
+               $results[] = $schemaMigrationService->performUpdateQueries($addCreateChange['change'], $statementHashesToPerform);
+               $results[] = $schemaMigrationService->performUpdateQueries($addCreateChange['create_table'], $statementHashesToPerform);
+
+               // Difference from current to expected
+               $dropRename = $schemaMigrationService->getDatabaseExtra($currentSchema, $expectedSchema);
+               $dropRename = $schemaMigrationService->getUpdateSuggestions($dropRename, 'remove');
+               $results[] = $schemaMigrationService->performUpdateQueries($dropRename['change'], $statementHashesToPerform);
+               $results[] = $schemaMigrationService->performUpdateQueries($dropRename['drop'], $statementHashesToPerform);
+               $results[] = $schemaMigrationService->performUpdateQueries($dropRename['change_table'], $statementHashesToPerform);
+               $results[] = $schemaMigrationService->performUpdateQueries($dropRename['drop_table'], $statementHashesToPerform);
+
+               // Create error flash messages if any
+               foreach ($results as $resultSet) {
+                       if (is_array($resultSet)) {
+                               foreach ($resultSet as $errorMessage) {
+                                       /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+                                       $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\ErrorStatus');
+                                       $message->setTitle('Database update failed');
+                                       $message->setMessage('Error: ' . $errorMessage);
+                                       $messages[] = $message;
+                               }
+                       }
+               }
+
+               /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
+               $message = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
+               $message->setTitle('Executed database updates');
+               $messages[] = $message;
+
+               return $messages;
+       }
+
+       /**
+        * "Compare" action of analyzer
+        *
+        * @TODO: The SchemaMigration API is a mess and should be refactored
+        * @TODO: Refactoring this should aim to make EM and dbal independent from ext:install by moving SchemaMigration to ext:core
+        * @return \TYPO3\CMS\Install\Status\StatusInterface
+        */
+       protected function databaseAnalyzerAnalyze() {
+               /** @var \TYPO3\CMS\Install\Service\SqlSchemaMigrationService $schemaMigrationService */
+               $schemaMigrationService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlSchemaMigrationService');
+               /** @var \TYPO3\CMS\Install\Service\SqlExpectedSchemaService $expectedSchemaService */
+               $expectedSchemaService = $this->objectManager->get('TYPO3\\CMS\\Install\\Service\\SqlExpectedSchemaService');
+               $expectedSchema = $expectedSchemaService->getExpectedDatabaseSchema();
+
+               $currentSchema = $schemaMigrationService->getFieldDefinitions_database();
+
+               $databaseAnalyzerSuggestion = array();
+
+               // Difference from expected to current
+               $addCreateChange = $schemaMigrationService->getDatabaseExtra($expectedSchema, $currentSchema);
+               $addCreateChange =&n