Developer Experience

Integration of the Composer Autoloader

Introduced in version 7.1

One major area the contributors worked on was a new autoloader for PHP classes that TYPO3 uses on a request. The previous complex logic is still kept for backwards-compatibility but the power and performance improvement that comes with new Composer-based class loader made lots of things easier. The new class loader takes full power of extensions that ship a composer.json and define a PSR-4 class standard. Any TYPO3 installation that is set up with Composer already benefits from the new changes completely. Any other installation that is set up the classic way by extracting a .zip file or tarball archive will use the Composer class loader for the TYPO3 extensions that are required for a minimal running system. For all other classes the still existing TYPO3 class loader does all the work.

Documentation

Pagination API for Listing Items

Introduced in version 10.2

Comfortably browsing through lists of items is a common use-case for websites and web applications alike. The TYPO3 core makes it easy for developers to implement such a solution that is also highly flexible and customizable. The new Pagination API lets users browse any kind of data — from database records to arrays and QueryResults. Everything that is “iterable” can be paginated and the TYPO3 core will make use of this useful API even more in the near future.

Documentation

New dependency injection

Introduced in version 10.0

The aforementioned goal to use robust and established standards and PHP packages throughout the TYPO3 core is also evident in another area of paramount importance: “dependency injection” (DI). This technique comes into play when one object supplies the dependencies of another object. PHP objects that do not contain state are called services and are logically encapsulated in service containers.

By applying Symfony’s Service Containers architecture we take dependency management and dependency injection for PHP classes to a new level. This approach aims to replace the Extbase dependency injection container and object manager which means we can do without both GeneralUtility::makeInstance() to retrieve singletons and static methods like getInstance() in the future.

Developers are encouraged to read the Symfony documentation and to keep an eye on the PSR-11 Initiative and its sub-tasks.

Documentation