CodeIgniter Forums
How to install & update CI4 with Composer? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: How to install & update CI4 with Composer? (/showthread.php?tid=66813)



How to install & update CI4 with Composer? - kenjis - 12-06-2016

Hi,

I want to update CI4 (to the latest commit) in my app with `composer update`.
Is there any way?


RE: How to install & update CI4 with Composer? - kilishan - 12-06-2016

CI4 is not currently listed on Packagist, so without adding a custom repository in your app's composer.json file, it's not possible at the moment, as far as I know.


RE: How to install & update CI4 with Composer? - kenjis - 12-06-2016

Adding a custom repository in my app's composer.json is no problem.

composer.json:
PHP Code:
{
 
   "repositories": [
 
       {
 
           "type""vcs",
 
           "url""https://github.com/bcit-ci/CodeIgniter4"
 
       }
 
   ],
 
   "require": {
 
       "codeigniter/framework""dev-develop"
 
   }


But if I install CI4 as a dependency via Composer, I still have to prepare some folders and files for my application manually, and adjust paths to the framework.

What do you plan for CI4 Composer installation?


RE: How to install & update CI4 with Composer? - kilishan - 12-07-2016

There hasn't been much discussion yet about what, if any, special tasks will be taken when installed by Composer. We're still trying to finish the framework itself. Smile

It sounds like you're possibly moving some folders around or doing other customization to the install. In that case, I don't know that a CI-specific installer is needed. It sounds more like you need to write a git hook or post install script to automate that stuff for you after install/update.


RE: How to install & update CI4 with Composer? - kenjis - 12-07-2016

I created https://github.com/kenjis/codeigniter-composer-installer for CI3.
It seems we need CI4 version.


RE: How to install & update CI4 with Composer? - kilishan - 12-07-2016

Some of those features could be nice to have, but it's too early to tell what will be officially supported.


RE: How to install & update CI4 with Composer? - sv3tli0 - 12-08-2016

I wrote maybe an year ago that it will be good if CI framework is not in 1 project with the base app.

Many other frameworks have proved that its good to have standalone framework repository and basic app (they can be more than 1 as Yii have Basic and Advanced apps which are good start points for further development).


RE: How to install & update CI4 with Composer? - kenjis - 01-17-2017

I've updated my CodeIgniter Composer Installer:
https://github.com/kenjis/codeigniter-composer-installer/tree/4.x