Welcome Guest, Not a member yet? Register   Sign In
Update CI 4.1.9 to Ci 4.2.1 via composer
#1

Hi,

As usual I update CI via composer from 4.1.9 -> 4.2.1 but this time I noticed that a lot file in "/vendor/codeigniter4/framework/app/config" got updated but my project file in "/app/config" didn't get updated. For example the new update got a file "Feature.php" where it's not reflected to my "app/config".

Do I need to manually update these files or dose CI manage these updates automatically?
Reply
#2

>Do I need to manually update these files

Yes, you need to.
https://codeigniter4.github.io/CodeIgnit...-upgrading
Composer update only updates "vendor/codeigniter4/framework", not update your Project Files.

> dose CI manage these updates automatically?

No.but there are tools for it.
https://packagist.org/explore/?query=cod...%20updates
Reply
#3

thank for help kenjis but I hit another roadblock. I went with the CLI solution. Script stopped with the below

************************************
* STAGING *
************************************

Updating files: 100% (8002/8002), done.
Switched to a new branch 'tatter/scratch'
cp: cannot stat 'vendor/codeigniter4/framework/app/': No such file or directory

now on this new branch it had not done anything. Below are the steps I did.

1. Install the tatter/patches library and commit to make it a clean branch.
2. Update composer (to CI 4.2.1)
3. Run the CLI script (./vendor/bin/patch -v 4.2.1)
Reply
#4

(This post was last modified: 07-14-2022, 12:11 AM by kenjis.)

It is a strange error.

> cp: cannot stat 'vendor/codeigniter4/framework/app/': No such file or directory

Why don't you have vendor/codeigniter4/framework/app/ ?

I tried and got the following.

Code:
$ vendor/bin/patch
git version 2.35.3
Composer version 2.3.9 2022-07-05 16:52:11
************************************
*          CONFIGURATION          *
************************************

Scripts Directory: /Users/kenji/tmp/ci419/vendor/tatter/patches/src
Project Directory: /Users/kenji/tmp/ci419
Target Version:   
Current Version: 
Source Package:    codeigniter4/framework
Base Branch:      main
Selected Items:    app/ public/ env spark

************************************
*            STAGING              *
************************************

Switched to a new branch 'tatter/scratch'
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading codeigniter4/framework (v4.1.9 => v4.2.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Upgrading codeigniter4/framework (v4.1.9 => v4.2.1): Extracting archive
Generating autoload files
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
infection/extension-installer: No extensions found
[tatter/scratch eeba37b] Patch framework
26 files changed, 1330 insertions(+), 1223 deletions(-)
rewrite Views/errors/html/debug.css (79%)
rewrite Views/errors/html/debug.js (90%)
rewrite Views/errors/html/error_404.php (95%)
rewrite Views/errors/html/error_exception.php (82%)
rewrite Views/errors/html/production.php (84%)
rewrite Views/welcome_message.php (97%)
Switched to a new branch 'tatter/patches'
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 0 installs, 1 update, 0 removals
  - Downgrading codeigniter4/framework (v4.2.1 => v4.1.9): Extracting archive
Generating autoload files
28 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
************************************
*              MERGING            *
************************************

[tatter/patches f33802b] Patch framework
Date: Thu Jul 14 16:04:32 2022 +0900
26 files changed, 1330 insertions(+), 1223 deletions(-)
rewrite app/Views/errors/html/debug.css (79%)
rewrite app/Views/errors/html/debug.js (90%)
rewrite app/Views/errors/html/error_404.php (95%)
rewrite app/Views/errors/html/error_exception.php (82%)
rewrite app/Views/errors/html/production.php (84%)
rewrite app/Views/welcome_message.php (97%)
************************************
*              SUCCESS            *
************************************

Patch successful! Updated files are available on branch tatter/patches.
Deleted branch tatter/scratch (was eeba37b).

Code:
$ git diff main...tatter/patches --name-only
app/Config/App.php
app/Config/Constants.php
app/Config/ContentSecurityPolicy.php
app/Config/Database.php
app/Config/Events.php
app/Config/Feature.php
app/Config/Filters.php
app/Config/Format.php
app/Config/Logger.php
app/Config/Mimes.php
app/Config/Publisher.php
app/Config/Routes.php
app/Config/Security.php
app/Config/Validation.php
app/Config/View.php
app/Controllers/BaseController.php
app/Views/errors/html/debug.css
app/Views/errors/html/debug.js
app/Views/errors/html/error_404.php
app/Views/errors/html/error_exception.php
app/Views/errors/html/production.php
app/Views/welcome_message.php
env
public/index.php
spark
writable/cache/index.html
Reply
#5

The problem I see is on the second step it changes the branch.

1. Updating files: 100% (8002/8002), done.
2. Switched to a new branch 'tatter/scratch'
3. cp: cannot stat 'vendor/codeigniter4/framework/app/': No such file or directory

So on this new branch it's missing the vendor folder. In this new branch I can see only the stuff that I have marked to ignore on git Big Grin.
It looks like the new branch is empty.
Reply
#6

@chakycool I have responded to your issue in the repo: https://github.com/tattersoftware/codeig.../issues/26

If you gather the requested info I am happy to help more. My guess is either your starting point was not a healthy installation of CI4 (did not have Composer packages installed, switched from develop to release, altered paths/subdirectories) or you have included your **vendor/** folder in the repo.
Reply
#7

Hi MGatner, I have shared all info you requested on GitHub.
I did include the vendor folder but I tried excluding it as well but ended with the same error MSG.
Did install CI4 via composer and working on 2 branches (master | dev) and I tried running the scrip from both branches and no luck.
Never touched any folder but the ./app folder.
Reply
#8

kenjis thanks for confirming what Mgatner pointed out about vendoring. Just buy updating the gitignore file it did not work. I had to delete git cache for it start ignoring the vendor folder. After that all worked as expected.

I'm including the vendor folder in git cause I have deployment pipeline in place, hence I don't want the server to run composer on every push (which I do allot).

Basically remember not to track the "vendor" folder if you want to run the tatter script in your projects.

Thank you Kenjis and Mgatner.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB