plugins.cakephp.org icon indicating copy to clipboard operation
plugins.cakephp.org copied to clipboard

Generate a composer repository with all the plugins

Open real34 opened this issue 12 years ago • 7 comments

Most of the plugins in the CakePHP community cannot be loaded using Composer without declaring a custom package. It would be great to make plugins.cakephp.org a Composer repository, using Satis for instance : http://getcomposer.org/doc/articles/handling-private-packages-with-satis.md

This ticket is created to start discussions about this feature. I think the information available for now are sufficient for working on a POC, and there will be rooms for improvements later.

Here are my thoughts:

  1. Implement a Satis configuration file generator from the database. Here is an untested draft:
{
    "name": "CakePHP Plugins",
    "homepage": "http://plugins.cakephp.org",
    "repositories": [
        {
            // Package example for a repository without composer.json file
            "type": "package",
            "package": {
                "type": "cakephp-plugin",
                "name": "CakeDC/migrations",
                "version": "master",
                "source": {
                    "url": "git://github.com/CakeDC/migrations.git",
                    "type": "git",
                    "reference": "master"
                },
                "require": {
                      "php": ">=5.2", // This information is not yet available on plugins.cakephp.org, but it is an example of improvement
                      "pear-cakephp/CakePHP": "2.1.3", // Another improvement example
                      "shama/baton": "*" // important so we can use installer for CakePHP specific types
                }
            }
        },
        { "type": "vcs", "url": "http://github.com/mycompany/privaterepo2" }, // if a composer.json file is detected
        { "type": "pear", "url": "http://pear.cakephp.org/" }
    ],
    "require-all": true
}
  1. Regenerate the file using a cron task to build the static Composer repository with satis (after each repository monitoring)

Promoting Composer as a plugin installer makes sense since it becomes widely used in the PHP ecosystem. It would be better imo than a custom made API as suggested in #23

real34 avatar Jun 20 '12 00:06 real34

:thumbsup:

shama avatar Jun 20 '12 01:06 shama

Seconded. Especially with CakePHP 2.x being PSR-0 compatible, we should try to use and promote Composer instead of a custom-made package/dependency manager.

Coincidentally, I've just released this Composer plugin for CakePHP yesterday to easily load Composer packages with CakePHP.

Also keeping a close eye on shama/baton for supporting installations of CakePHP components on Composer.

uzyn avatar Jun 20 '12 10:06 uzyn

It's probably worth noting that @josegonzalez has been talking about Composer integration for a long time. Baton came entirely from his influence. So to clarify my thumbs up, I'm all for Composer integration with cakepackages just as long as it's inline with @josegonzalez.

shama avatar Jun 20 '12 16:06 shama

Totally fine with me. It's more of a "when does @josegonzalez buy a bottle of rum and start programming" problem than anything else. If anyone wants to take the lead on it, let me know and I'm down to tell you how it would work :)

For the record, I've already rebuilt the Satis stuff in ruby, so it's trivial to do the same for CakePHP, or just pull in all of composer :P

josegonzalez avatar Jun 20 '12 20:06 josegonzalez

I have some time and am all for getting Composer into CakePHP. @josegonzalez I would love to take a shot at this. Let me know what you think and I would give it a shot.

uzyn avatar Jun 21 '12 01:06 uzyn

:heart_decoration:

rchavik avatar Jun 21 '12 12:06 rchavik

Looked into the bottle of rum issue. Unfortunately it is illegal for me to ship liquor to NY. So I guess I'll just help with programming and give you a virtual :cocktail:

shama avatar Jun 21 '12 21:06 shama