Welcome Guest, Not a member yet? Register   Sign In
How do i install older version of CI4 using composer
#1

Hi,
How do i install older version (eg. 4.1.5) using composer. Sometimes i get unexplained behavior in the latest versions and i need retest under older versions.
I could not get any help in the internet (as usual), i am posting here for help.

Thank you
Reply
#2

(This post was last modified: 02-21-2022, 09:07 PM by kenjis.)

E.g.
Code:
$ composer require codeigniter4/framework:4.1.5 -W
Reply
#3

https://stackoverflow.com/questions/4091...g-composer

Code:
composer require codeigniter4/framework:4.1.5
Reply
#4

Do i just enter this line in the command line? What happen creating the initial app? I tried entering this at the command line and i got errors. I want to do a full install of the older version of codeigniter 4.
Reply
#5

(This post was last modified: 06-13-2022, 07:06 AM by murugappan.)

(02-21-2022, 09:01 PM)paulbalandan Wrote: https://stackoverflow.com/questions/4091...g-composer

Code:
composer require codeigniter4/framework:4.1.5

Hi this seems incomplete. Composer require needs a previous installation. It cannot be used to create a new project. I was told to use this

Code:
composer create-project codeigniter4/appstarter:4.1.9 project-name

This did not work either. What is the correct way to install an older full version of CI4 using composer?? I notice something peculiar in the composer install. Although, the installer initially stated it was extracting v4.1.9 archive, it was later installing version 4.2.0 framework.

Code:
Installing codeigniter4/appstarter (v4.1.9)
  - Installing codeigniter4/appstarter (v4.1.9): Extracting archive
Created project in C:\xampp\htdocs\MyCoursesLG\ci4vaniila\projectx
Loading composer repositories with package information
Updating dependencies
Lock file operations: 41 installs, 0 updates, 0 removals
  - Locking codeigniter4/framework (v4.2.0)
  - Locking doctrine/instantiator (1.4.1)
  - Locking fakerphp/faker (v1.19.0)
  - Locking kint-php/kint (4.1.2)
  - Locking laminas/laminas-escaper (2.10.0)
  - Locking mikey179/vfsstream (v1.6.10)

Is there anyone who can help me on this?
Reply
#6

(06-09-2022, 07:45 AM)murugappan Wrote:
(02-21-2022, 09:01 PM)paulbalandan Wrote: https://stackoverflow.com/questions/4091...g-composer

Code:
composer require codeigniter4/framework:4.1.5

Hi this seems incomplete. Composer require needs a previous installation. It cannot be used to create a new project. I was told to use this

Code:
composer create-project codeigniter4/appstarter:4.1.9 project-name

This did not work either. What is the correct way to install an older full version of CI4 using composer?? I notice something peculiar in the composer install. Although, the installer initially stated it was extracting v4.1.9 archive, it was later installing version 4.2.0 framework.

Code:
Installing codeigniter4/appstarter (v4.1.9)
  - Installing codeigniter4/appstarter (v4.1.9): Extracting archive
Created project in C:\xampp\htdocs\MyCoursesLG\ci4vaniila\projectx
Loading composer repositories with package information
Updating dependencies
Lock file operations: 41 installs, 0 updates, 0 removals
  - Locking codeigniter4/framework (v4.2.0)
  - Locking doctrine/instantiator (1.4.1)
  - Locking fakerphp/faker (v1.19.0)
  - Locking kint-php/kint (4.1.2)
  - Locking laminas/laminas-escaper (2.10.0)
  - Locking mikey179/vfsstream (v1.6.10)

Is there anyone who can help me on this?
@kenjis 

Looks like no one, even the CI4 support staff, know the answer to their own problem. At this rate of support, it is no wonder there is not much users for CI4 and all new app and software developers are supporting Laravel instead. I love CI4 and its capabilities. Please do not change our perception and get all our user community to dump CI4. Please help!
Reply
#7

(This post was last modified: 06-15-2022, 03:02 PM by kenjis.)

Sorry, if you don't know Composer's basic usage, you can't install older version of CI4 via Composer.
As you know, the cause is that the latest version framework (v4.2.0) will be installed.
So all you have to do is changing the version of framework and downgrade it in your project.

This is because appstarter specifies framework version "^4", that is 4 or later and not 5.
If we specified "4.1.9", this error does not happen, but if so, we can't update framework by `composer update`.
Because the specific version is fixed.

I recommend you use Zip download to test older version .

And I recommend you read Composer documentation.

Introduction - Composer
https://getcomposer.org/doc/00-intro.md
Basic usage - Composer
https://getcomposer.org/doc/01-basic-usage.md
Reply
#8

This is how to install older version:

Code:
$ composer create-project codeigniter4/appstarter:4.1.9 ci419
$ cd ci419/
$ composer require codeigniter4/framework:4.1.9

Code:
$ php spark routes

CodeIgniter v4.1.9 Command Line Tool - Server Time: 2022-06-15 17:40:15 UTC-05:00

+--------+----------------------------+------------------------------------------------+
| Method | Route                      | Handler                                        |
+--------+----------------------------+------------------------------------------------+
| GET    | /                          | \App\Controllers\Home::index                  |
| CLI    | migrations/([^/]+)/([^/]+) | \CodeIgniter\Commands\MigrationsCommand::$1/$2 |
| CLI    | migrations/([^/]+)        | \CodeIgniter\Commands\MigrationsCommand::$1    |
| CLI    | migrations                | \CodeIgniter\Commands\MigrationsCommand::index |
| CLI    | ci(.*)                    | \CodeIgniter\CLI\CommandRunner::index/$1      |
+--------+----------------------------+------------------------------------------------+
Reply
#9

(06-15-2022, 02:25 PM)kenjis Wrote: Sorry, if you don't know Composer's basic usage, you can't install older version of CI4 via Composer.
As you know, the cause is that the latest version framework (v4.2.0) will be installed.
So all you have to do is changing the version of framework and downgrade it in your project.

This is because appstarter specifies framework version "^4", that is 4 or later and not 5.
If we specified "4.1.9", this error does not happen, but if so, we can't update framework by `composer update`.
Because the specific version is fixed.

I recommend you use Zip download to test older version .

And I recommend you read Composer documentation.

Introduction - Composer
https://getcomposer.org/doc/00-intro.md
Basic usage - Composer
https://getcomposer.org/doc/01-basic-usage.md

Hi, I am familiar with Composer and have been using CI since version 2. The previous documentation of ci3 had instruction on how to install older version. Since CI4 this is now missing. Anyway, it works now.

Thank you.
Reply
#10

If you think something missing in the documentation, you can send PRs to improve it.

See https://github.com/codeigniter4/CodeIgni.../README.md
Reply




Theme © iAndrew 2016 - Forum software by © MyBB