What is New In CodeIgniter 4.x?
February 2020 update (CodeIgniter 4 was launched)
On February 24, 2020, which would be Jim Perry's birthday, CodeIgniter 4 was launched, in honor of the professional who he devoted a good part of his time in bringing the framework back to the market, with conditions to compete with the other existing frameworks and more updated in relation to resources and PHP itself.
Following features of CodeIgniter 4
- It required the *intl* extension of PHP installed on the server.
- If we would like to use CURLRequest, we will need a lib curl installed.
- Supported databases are:
- MySQL (5.1+) via the MySQLi driver
- PostgreSQL via the Postgre driver
- SqLite3 via the SQLite3 driver
- It is not compatible with PHP versions below 7.2.
Comparison between CodeIgniter 4.x with CodeIgniter 3.x
CodeIgniter 4 is very different from 3 and below you will see a little about the main differences between them.
- CodeIgniter 4 has app and system folders, where app is for your application and system for the framework.
- You can now use namespaces.
- You can now use composer.
- You can now use .env files.
- You can now use PSR-4 autoloading.
Installation
CodeIgniter 4 can be installed using many methods
- In Manual Installation, you need to download the latest release from the official site and can place it in your www/htdocs directory after extracting it.
Note: This is the installation technique closest to that described for CodeIgniter 3. - If you want to use the composer tool you need to install the composer first and then you can install using the command line. Composer will also help you to add third-party plugins in your project in the future.
- You can download and install the composer from this link: https://getcomposer.org/
- You can also clone the git repository of CodeIgniter.
Conclusion
We should use CodeIgniter 4 because we have new features along with security. The most striking and obvious change to the previous versions is the fact that there is now a public directory. Like in other frameworks this has an essential and security-related background: the separation of application/framework and public resources (as like Javascript, CSS or images). Due to the fact that the framework will be revealed not so freely, it is much more difficult for potential attackers to find vulnerabilities or deliberately exploit.
