- Status: accepted
- Deciders: Kevin TRAINI
- Date: 2024-11-04
Currently, many plugins set their own PHP namespace on multiple directories. For example plugin Tracker sets its namespace
Tuleap\Tracker
on both include/
and include/Tracker/
. The same problem appears for tests directories.
This situation leads to some confusion and even duplications.
- Use
include/
- Use
include/<plugin_name>/
Chosen option: use include/
, because it avoids a repetition in the path (for example plugins/tracker/include/Tracker/
).
composer.json
of each plugin will now link plugin namespace Tuleap\PluginName
to the include/
directory. For tests, it will
link it to tests/unit
, tests/rest
and tests/integration
.
{
"autoload": {
"psr-4": {
"Tuleap\\PluginName\\": ["include/"]
}
},
"autoload-dev": {
"psr-4": {
"Tuleap\\PluginName\\": ["tests/unit/", "tests/integration/", "tests/rest/"]
}
}
}