CodeIgniter Forums
How-to update codeigniter4 framework via composer? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: How-to update codeigniter4 framework via composer? (/showthread.php?tid=72301)

Pages: 1 2


How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

Hi all,

I installed alpha2 via this command:

composer create-project codeigniter4/framework

(or I think I may have actually usedSmile

composer install codeigniter4/framework:dev-master

How do I update to alpha3 using composer? I ran:

composer update

in the framework directory and it only updated:

Package operations: 0 installs, 2 updates, 0 removals
  - Updating sebastian/environment (3.1.0 => 4.0.1): Downloading (100%)
  - Updating phpunit/phpunit (7.4.3 => 7.4.4): Downloading (100%)


I'm new to composer- could someone please tell me the command to update the entire framework from alpha2->alpha3?

Also, I'm concerned my application and public directories will get overridden. Is composer smart enough to leave those alone?

Thanks so much!

-Kyle


RE: How-to update codeigniter4 framework via composer? - ciadmin - 12-01-2018

A "composer create-project codeigniter4/framework" creates the project, but the composer dependencies in it refer to third party packages, and I am not sure if "composer update" will work as you intend.

Any project which is based on the framework directly will have the same problem going forward, and that has been true with CodeIgniter 3 too.

We have a new (and experimental) solution: the CodeIgniter4 app-starter. It comes only with application & public, and the "framework" is composer-installed inside "vendor". A "composer update" after this would then update the nested framework Smile

Yes, that means re-building your project folder, but hopefully only once!


RE: How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

ciadmin, thanks for the quick reply, this sounds like a good solution! How do I rebuild my project folder? What steps do I need to take given the way I first installed the project?


RE: How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

I have a feeling the process will be rename framework to framework_old and then install codeigniter4/appstarter and then move my application and other files over as needed. Am I thinking about that correctly? A slight issue I'm having...

composer create-project codeigniter4/appstarter


[InvalidArgumentException]
Could not find package codeigniter4/appstarter with stability stable.


RE: How-to update codeigniter4 framework via composer? - InsiteFX - 12-01-2018

You should only need to copy over the system folder unless changes have been made
to the application folder.


RE: How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

I realize that would be the easy way Smile In fact, that's the way I've been doing web development for a long time. I'm trying to get hip with the cool kids and do the whole composer thing.


RE: How-to update codeigniter4 framework via composer? - ciadmin - 12-01-2018

Sorry, but I have messed up the "composer thing" and am working on resolving it.
My first mistake was not setting up the appstarter package in packagist!
That's been resolved, but it is now complaing about stability compatibility and installable requirements.
The fun never ends, but it will be worth it in the end.

I did say that the appstarter was experimental ... phew!


RE: How-to update codeigniter4 framework via composer? - ciadmin - 12-01-2018

Ok - resolved Undecided
Apart from fixing the depedency, we need to tell composer that an alpha version is stable enough:

composer create-project -s alpha codeigniter4/appstarter YOUR_PROJECT


RE: How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

Ok, cool... we are getting closer. I ran php spark serve and it won't run:

C:\Users\Kyle\Desktop\OGD\appstarter>php spark serve

Warning: require(system/bootstrap.php): failed to open stream: No such file or directory in C:\Users\Kyle\Desktop\OGD\appstarter\spark on line 47

Fatal error: require(): Failed opening required 'system/bootstrap.php' (include_path='.;C:\php\pear') in C:\Users\Kyle\Desktop\OGD\appstarter\spark on line 47


RE: How-to update codeigniter4 framework via composer? - NiteRaven - 12-01-2018

I'm guessing the paths, specifically system, has changed since ci4 is in the vendor folder now?