[TASK] Release installation procedure from LocalConfiguration file 06/19506/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 1 Apr 2013 20:53:36 +0000 (22:53 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 2 Apr 2013 18:38:45 +0000 (20:38 +0200)
commit5cd8ec07f16ef0025960c0ebfc874cd242451ab5
tree422fa4878447529a8f09fa506fe35757e092ae52
parent1421f90e5c8e5f501c7d0710a21823e5f33766f1
[TASK] Release installation procedure from LocalConfiguration file

The dummy, government and introduction packages deliver with a
default typo3conf/LocalConfiguration.php file to set defaults. If
the installation was not yet completed, those files do not contain
database settings. The bootstrap loads LocalConfiguration and
redirects to the install tool in 123 mode, if those db credentials
are missing. This is ugly and leads to several headaches.

The patch introduces a new file called "FactoryConfiguration.php"
within ext:core Configuration directory to set those defaults now.
The packages can overload these settings with an own file in
typo3conf called "AdditionalFactoryConfiguration", eg. to load the
specific extensions needed during the install process.

This way, the packages do not deliver a "LocalConfiguration" file
anymore. The boostrap now just checks for the existence of the file
and redirects to the install tool if it doesn't exist. The install
tool then creates the "LocalConfiguration" from the factory files
at an early point in the process.

The patch has to deal with different side effect of this:
* ConfigurationManager is no singleton anymore, there was no reason
  for that in the first place anyway.
* ConfigurationManager has a new method to deal with the factory
  files.
* ConfigurationManager got some refactoring to get rid of constants
* Bootstrap is adapted to the new file existance handling.
* GeneralUtility::fixPermissions now can give default permission
  values for files if the settings do not exist yet.
* GeneralUtility::writeFile now accepts a new argument to force
  setting permissions. This is used in ConfigurationManager to
  end up with a LocalConfigurationFile with correct permissions
  as soon as installation is completed.
* As usual, the patch has a good test coverage to show everything
  works as expected.

Change-Id: Icb644534e6d1f426bc9512a941a69d3ee3727223
Resolves: #46854
Releases: 6.1
Reviewed-on: https://review.typo3.org/19506
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
15 files changed:
index.php
typo3/init.php
typo3/install/index.php
typo3/sysext/core/Classes/Configuration/ConfigurationManager.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Configuration/FactoryConfiguration.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/install/Classes/CoreUpdates/LocalConfigurationUpdate.php
typo3/sysext/install/Classes/InstallBootstrap.php
typo3/sysext/install/Classes/Installer.php