ciolben / php-code-block

Concrete5 add-on
MIT License
0 stars 1 forks source link

Add Composer/Packagist support? #2

Open mlocati opened 6 years ago

mlocati commented 6 years ago

Since concrete5 8 (8.2 I think), we can install concrete5 packages using composer.

It would be nice if php-code-blocks support this.

This would require:

  1. avoid the use of a sub-directory in the github repository (so, the contents of https://github.com/ciolben/php-code-block/tree/master/phpcodeblock should go directly to https://github.com/ciolben/php-code-block/tree/master)
  2. add a composer.json file to the root of the directory, where:
  3. submit this package to Packagist
  4. create git tags with the same version specified in the package controller.php.
    This basicaly means that you need to create a new version every time you update $pkgVersion in controller.php

This will let people install your addon easily with composer.

For instance, here's a sample session that will download concrete5 8.3.2, install it, download my vatcode_codicefiscale package and install it:

$ composer create-project concrete5/composer my-site
$ cd my-site
$ ./public/concrete/bin/concrete5 c5:install --interactive
$ composer require mlocati-concrete5-packages/vatcode_codicefiscale
$ ./public/concrete/bin/concrete5 c5:package:install vatcode_codicefiscale

when a new package version is released, you can simply call

$ composer update mlocati-concrete5-packages/vatcode_codicefiscale
$ ./public/concrete/bin/concrete5 c5:package:update vatcode_codicefiscale
ciolben commented 6 years ago

I'am not using this configuration, but it would be a nice addition. If anyone wants to add the support for composer, feel free to do a pull request.

mlocati commented 6 years ago

If anyone wants to add the support for composer, feel free to do a pull request.

Done in #3 :wink: