Closed aschempp closed 9 years ago
I did rewrite A LOT on the plugin today. I think I now have also completely understand how it works and what it's supposed to do to solve our problem (regarding installation). Explained in composer.json
terms, it's fairly simply:
contao/core
is already installed in the version of the available Contao installation.This contao/core
package now has a section that says
"replace": {
"contao/core-bundle": self.version,
"contao/news-bundle": self.version,
"contao/calendar-bundle": self.version
/* … all contao/contao 4 bundles */
}
contao/core
and all bundles.Providing the packages will composer tell not to install anything if the given version is compatible with the requirements of a to-be-installed package. Having the requirement in the root will prevent composer from trying to update any of these packages, but fail to add the to-be-installed package.
For existing packages, adding "require": { "contao/core": >3.2,<4 }
will work perfectly if Contao 3.4 is installed.
For packages supporting Contao 3 and 4, the requirement must be "require": { "contao/core-bundle": >3.2,<5 }
. In Contao 3, the plugin will take care of "providing" contao/core-bundle
. In Contao 4, it's actually available in composer (the plugin does not provide any package information on Contao 4).
How do we want to continue here? If there is no feedback from anyone, we can't continue with the development.
I'm not familiar with the CCA organisation, is the organisation supposed to support this repo? Otherwise if there is noone available to maintain it, maybe it should be transferred?
/cc @xtra @tristanlins
I'm out of scope :-/
/fw @xtra
@aschempp Sorry I had no time to make indepth checks and tests on your approach. As we discussed on mumble while you were initially writing this, I am still not convinced that all the corner cases we solved in the past will still be covered.
The overall picture I see here, as described in your comment before, is pretty good and nifty. Yet it must be polished.
Now a little offtopic On the generic question about maintaining this, yes the CCA is maintaining it. But as you might have already noticed, we are a bunch of Contao enthusiasts dedicating our spare time to projects for the public. We maintain projects because "there is a need for them" or because they need an incubation home. The bad part of the story is, that aside from @stefanheimes and myself, we have pretty few people in the CCA that are able to code but way too many (important) projects that would need more manpower. Therefore it simply takes time to check all PRs and issues, I bet you know that. :)
So how should we continue here? My PR is supposed to show that my attempt works. Would it make sense to get the composer plugin developed by the Contao core team? Because it is pretty essential for all extension developers and therefore the success of Contao imho.
I have rebased your PR and fixed the unit test as good as I could. See contao4 branch.
The contao4 environment however is not tested at all yet.
This PR aims to fix https://github.com/contao/core-bundle/issues/278
The example extension can be found at https://github.com/aschempp/composer-test/blob/master/composer.json. The requirements are set on
contao/core-bundle
(orcontao/news-bundle
etc.)I had to make slight adjustments to the composer-client just to make it allow to install the develop-version of the plugin.
So far it works
In Contao 3
repositories
for my fork ofcomposer-plugin
, composer-client and composer-test in yourcomposer.json
aschempp/composer-test
works from both backend and command linePerforming migration in the backend caused a 30-sec timeout for me, because it tries to pull
contao/core-bundle
and all Symfony dependencies. That is however an existing problem of the Contao composer client, because it does install dependencies ofcontao/core
(orcontao/core-bundle
) before the plugin is active and can stop it. We need to find a new workaround for that.In Contao 4
composer create-project contao/standard-edition Contao4 4.*@dev
repositories
for my fork ofcomposer-plugin
, composer-client and composer-test in yourcomposer.json
aschempp/composer-test
works on the command linecomposer update
several times. This is a known issue to the existing composer plugin.ToDos
contao/core
and all other "provides" are disallowed when requested by an extension/cc @discordier @leofeyer @Toflar