• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How-to update codeigniter4 framework via composer?

#1
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
Reply

#2
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!
Reply

#3
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?
Reply

#4
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.
Reply

#5
You should only need to copy over the system folder unless changes have been made
to the application folder.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#6
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.
Reply

#7
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!
Reply

#8
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
Reply

#9
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
Reply

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.