Reputation: 143
Why does the following root composer.json
result in an vendor/composer/autoload_classmap.php
containing all the class mappings for Smarty's classes – although the composer.json
of typo3-ter/smarty
does not come with any autoload
configuration?
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org"
}
],
"require": {
"typo3/cms": "^6.2",
"typo3-ter/smarty": "2.1.2"
}
}
Upvotes: 2
Views: 762
Reputation: 463
Some background info:
https://composer.typo3.org is a composer repository, which enables legacy TYPO3 Extension Repository (TER) extensions to be installable via composer. Because TER extensions do not have a vendor name, all of them share the same vendor, which is "typo3-ter".
This (legacy) composer repository is built by using meta information (dependencies to other TER extensions and TYPO3 versions, author, description …) from TER.
To make this repository more useful for end users and especially because TYPO3 >7.6 completely relies on the composer autoloader when installed via composer, the complete extension directory is added to the composer classmap. Without that, extension classes would not be loadable at all, without any additional configuration.
Because this can cause trouble, I taught TER to partially capture information from composer.json in case this file is present. This means if a composer.json is present and it contains an autoload section, this section is used to generate the autoload information for this extension on composer.typo3.org
Regarding the smarty extension:
Surprisingly this extension has a composer.json file already. But it is broken. First and foremost: It misses autoload information, although it clearly has classes available. Because of the lack of autoload information, the composer.typo3.org package generator adds the complete directory as classmap.
If this causes trouble (you never mentioned that, but I assume so), you should add the repo directly as type "vcs" to your composer.json and require "rtp/smarty" instead of "typo3-ter/smarty".
Or you ask the author to fix the composer.json and upload a new version to TER, or even better register that package directly on packagist.org
Upvotes: 6