2

I like using CodeIgniter because I don't need composer. However, I am trying to install Shield for CodeIgniter (Authentication and Authorization for CodeIgniter 4) and I don't find how to install it without Composer.

Is it even possible?

hakre
  • 193,403
  • 52
  • 435
  • 836
user1314836
  • 219
  • 1
  • 4
  • 14

2 Answers2

4

Yes, it is mentioned in the documentation that Composer is needed, but this does not mean that it is not possible to install it manually. You can install manually, but this is not recommended. I have provided instructions for manual installation in the link below:

How to Install Shield for CodeIgniter 4 without composer

datamweb
  • 81
  • 1
  • Thank you for the detailed documentation you wrote! Finally I tried and used Composer for my first time. Now I am not sure if should switch and have CodeIgniter 4 be updated through Composer instead of manually. – user1314836 Jan 06 '23 at 19:54
0

No, you need composer: from Codeigniter Shield Installation Requirements:

Requirements

  • Composer
  • Codeigniter v4.2.3 or later
  • A created database that you can access via the Spark CLI script

After Installation, you can opt between Command Setup and Manual Setup

note: I'd also recommend to install CI4 with composer, at least for a clean installation on your local host. If your production server is a shared server and composer is difficult/impossible to run, you can create a clone from your localhost.

Vickel
  • 7,879
  • 6
  • 35
  • 56
  • Why is CI4 better with composer than directly downloading it? I started programming with CodeIgniter (version 3) precisely because it could be installed without Composer. I don't really like it (probably because I haven't used up to now and understood its virtues). – user1314836 Dec 28 '22 at 16:47
  • @user1314836 concerning CI4 installation, I didn't say it is better, but in my experience it is flawless and really easy to use composer on your localhost, while it might be a bit of a nightmare on a shared production server. Therefore composer install on localhost and then copy a clone to your production server to overcome those composer issues on shared servers. – Vickel Dec 28 '22 at 16:56
  • How does it work? I download CodeIgniter 4 and I change configuration files, create models... if I use Composer, will it go to the "vendor" folder, and how will I create my app? – user1314836 Dec 28 '22 at 17:00
  • Best is to start from scratch, make a new composer installation of CI4. Copy your existing controllers, views, models to create your app. Then install shield, then config shield and write your code – Vickel Dec 28 '22 at 17:26