kenjis / codeigniter-composer-installer

Installs the offical CodeIgniter 3 with secure folder structure via Composer
MIT License
377 stars 118 forks source link

Installation for Kenji's Twig Library #22

Open komputronika opened 6 years ago

komputronika commented 6 years ago

This additional code is for install CI libraries that depend on other package. For example: https://github.com/kenjis/codeigniter-ss-twig

The steps are:

  1. Add new package definition to array $this->packages, with a new key 'require'.
  2. Method install will doing additional task: Update composer.json with new requirement and then run composer update.

Test result:

$ ./bin/install.php twig master
Downloaded: https://github.com/kenjis/codeigniter-ss-twig/archive/master.zip
copied: /media/windows/Web/codeigniter-composer-installer-demo/application/libraries/Twig.php
Installing package: CodeIgniter3 Simple and Secure Twig Integration
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
Installed: twig
See https://github.com/kenjis/codeigniter-ss-twig

Thank you.

21

kenjis commented 6 years ago

@komputronika Why do you want to use bin/install.php to install Composer pacakges? You can just run composer command to install Composer pacakges.

komputronika commented 6 years ago

Hello Kenji,

As I said before. this additional code is for install CI libraries that depend on other package. For example: https://github.com/kenjis/codeigniter-ss-twig

Yes we can install for example, Twig with composer directly. But your codeigniter-ss-twig library has wrapped Twig class so easy to use with Codeigniter. (there is folder libraries inside).

Another example library that depend on other composer package is your codeigniter doctrine library.

Thanks.