Attention
TYPO3 v11 has reached end-of-life as of October 31st 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
Best Practices
The sections specific to migrating to Composer are still here.
Completely clear typo3conf/ext
folder
In the "Migration Steps" chapter, this tutorial explained, how you can
keep your individual extension in "typo3conf/ext"
and in the "Co-working" section, there was a part about how to add rules
to your .gitignore
file to exclude typo3conf/
from,
but keep your individual extensions in Git.
If you are searching for a solution to keep your typo3conf/
folder
clean and unify the extension handling even for your project's individual
extension, this section might be useful.
Define a local path repository
Create a directory packages
in your project root folder and define
this folder as a repository of type "path" in your composer.
:
{
"repositories": [
{
"type": "path",
"url": "./packages/*"
}
]
}
Include your individual extensions from packages
folder
In the next step, you move all your individual extensions from
public/
to packages
. And for this way to include them,
it's important, that each extension has it's own correct composer.
file.
How this file should look in your extension, is documented in Extension Development Documentation or
this blog post from Helmut Hummel.
Assumed, your package key is, foo/bar
, you can type the following command
to include your extension to your project:
composer require foo/bar:@dev
In this case, it's the easiest way to not define any composer version
number, but tell composer to use the latest dev
state.
Note
The autoload
information now comes with the extension's
composer.
and can be removed from your project's
composer.
.
Exclude typo3conf/ext
from version control system
To finish your cleanup of "typo3conf/ext", you should keep the line
/public/typo3conf/ext/*
in your .gitignore
, but remove all lines,
starting with !/public/typo3conf/ext/
.