Task #83951

Epic #83968: PSR-11 Initiative

Decouple Bootstrap and Application initialization

Added by Benjamin Franzke almost 2 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
Start date:
2018-02-17
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

In order to support full-application subrequests (later on),
bootstraping, application initialization and application execution
should be decoupled.

To be able to initialize a frontend Application in backend
Application context, the frontend Application should not re-execute
bootstraping code.

That means:
  • Bootstrap should be limited to bootstrapping (oh wonder!)
    => setting up global services/whatever, not more.
  • A Container (PSR-11) performs initialization
    => e.g. `new Frontend/Http/Application()`
  • Application performs execution
    => checking possible (application specifc redirects)
    => offloading work to the request handler

Associated revisions

Revision a388232d (diff)
Added by Benjamin Franzke over 1 year ago

[TASK] Decouple Bootstrap and Application engaging a PSR-11 container

In order to avoid global state and to support full-application
subrequests (later on), bootstraping, application initialization
and application execution needs to be decoupled.
(To be able to initialize a frontend Application in backend
Application context, the frontend Application may not re-execute
bootstraping code.)

That means from now on: * Bootstrap is limited to stateless bootstrapping
=> setting up package manager and configuration * A (new) Container (PSR-11) performs class initialization
=> e.g. `new Frontend/Http/Application()` * Application performs execution
=> checking possible (application specific) redirects
=> offloading work to the request handler

This commit transforms Bootstrap into a (static) bootstrap utility
that returns a container (minimal, static PSR-11 implementation).
The entry-point scripts execute the bootstraper and use
the returned container to initialize and run the application.

This commit acts as a starting point for a broader PSR-11 container
support in TYPO3. We do – on purpose – use an own, very limited, anonymous
and static there is no configuration) PSR-11 implemententation for now.
This interim container implementation will be replaced by whatever
PSR-11 supporting container solution we use later on.
That keeps the necessary Bootstrap refactoring seperate from the
introduction of a full dependency injection container implementation.

All existing bootstrap methods keep working as before but the non-static
method invocation should be deprecated at some point.

typo3/cms-cli is adapted for the changed entry point script with:
https://github.com/TYPO3/cms-cli/pull/1

typo3/testing-framework is adapted in
https://github.com/TYPO3/testing-framework/pull/55

This patch brings one important behavioral change:

The install tool redirect (if essential configuration is missing) is
perfomed during application execution – after the configuration has been
loaded (falling back to failsafe mode if missing) – now. Previously the
application performed the redirect before it would call Bootstraps
configure() method. Now that the Application is decoupled from bootstrap,
the bootstrapper ensures it can always create an Application class, in
order for the application to be in charge of the decision what should
happen if essential configuration is missing.

Dependency changes:

composer require psr/container:^1.0
composer require typo3/cms-cli:^2.0
composer require typo3/testing-framework:^3.2 --dev

Change-Id: Idc59665dfcf7250a8a42b3d908a5a2376067700c
Releases: master
Resolves: #83951
Reviewed-on: https://review.typo3.org/55773
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review almost 2 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#2 Updated by Gerrit Code Review almost 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#3 Updated by Gerrit Code Review almost 2 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#4 Updated by Gerrit Code Review almost 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#5 Updated by Frank Naegler over 1 year ago

  • Parent task set to #83968

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#12 Updated by Gerrit Code Review over 1 year ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#13 Updated by Gerrit Code Review over 1 year ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#14 Updated by Gerrit Code Review over 1 year ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#15 Updated by Gerrit Code Review over 1 year ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#16 Updated by Gerrit Code Review over 1 year ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#17 Updated by Gerrit Code Review over 1 year ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#18 Updated by Gerrit Code Review over 1 year ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#19 Updated by Gerrit Code Review over 1 year ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#20 Updated by Gerrit Code Review over 1 year ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#21 Updated by Gerrit Code Review over 1 year ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#22 Updated by Gerrit Code Review over 1 year ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#23 Updated by Gerrit Code Review over 1 year ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#24 Updated by Gerrit Code Review over 1 year ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#25 Updated by Gerrit Code Review over 1 year ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#26 Updated by Gerrit Code Review over 1 year ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#27 Updated by Gerrit Code Review over 1 year ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#28 Updated by Gerrit Code Review over 1 year ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#29 Updated by Gerrit Code Review over 1 year ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#30 Updated by Gerrit Code Review over 1 year ago

Patch set 29 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#31 Updated by Gerrit Code Review over 1 year ago

Patch set 30 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#32 Updated by Gerrit Code Review over 1 year ago

Patch set 31 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#33 Updated by Gerrit Code Review over 1 year ago

Patch set 32 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#34 Updated by Gerrit Code Review over 1 year ago

Patch set 33 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#35 Updated by Gerrit Code Review over 1 year ago

Patch set 34 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#36 Updated by Gerrit Code Review over 1 year ago

Patch set 35 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#37 Updated by Gerrit Code Review over 1 year ago

Patch set 36 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#38 Updated by Gerrit Code Review over 1 year ago

Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#39 Updated by Gerrit Code Review over 1 year ago

Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#40 Updated by Gerrit Code Review over 1 year ago

Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#41 Updated by Gerrit Code Review over 1 year ago

Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#42 Updated by Gerrit Code Review over 1 year ago

Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#43 Updated by Gerrit Code Review over 1 year ago

Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#44 Updated by Gerrit Code Review over 1 year ago

Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#45 Updated by Gerrit Code Review over 1 year ago

Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#46 Updated by Gerrit Code Review over 1 year ago

Patch set 45 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#47 Updated by Gerrit Code Review over 1 year ago

Patch set 46 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#48 Updated by Gerrit Code Review over 1 year ago

Patch set 47 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#49 Updated by Gerrit Code Review over 1 year ago

Patch set 48 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#50 Updated by Gerrit Code Review over 1 year ago

Patch set 49 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#51 Updated by Gerrit Code Review over 1 year ago

Patch set 50 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55773

#52 Updated by Benjamin Franzke over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#53 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF