init.php enhancements

typo3/init.php has become a very large file where a lot of initializations take place. It is called in many contexts, in particular normal BE operation, BE AJAX calls, Install Tool access and CLI scripts. This has a great potential for interference when some stuff is added with only one request type in mind (and that happened a couple of times in the past already).

The goal of this project is to provide a number of initializations modules that can be included easily so that each request type can build its own initialization sequence without duplicating code. This would greatly reduce the risk of destructive interferences. It would also eliminate the need for tests and branching during the initialization sequences, since each sequence would be matched to its request type.

In a first phase, the project will concentrate on cleaning up init.php itself and reduce its usage throughout the core (where it is called by obsolete scripts, or by BE modules that still don't use the dispatch mechanism). Once the ground is clear, it will be easier to start the refactoring.

About the attached files:

  1. there's a flow chart of the processes that take place inside typo3/init.php, without digging into subprocesses (like authentication), although there are dependencies on request type hidden in these sometimes. Color codes are used to indicate which processes are used in which type of request.
  1. the mind map is the result of the workshop held during T3DD10. On the left side it shows how the typo3/init.php can be cut into modules for refactoring. The right side shows various other notes, including the cleanups.

Updated by Francois Suter over 10 years ago ยท 2 revisions