CodeIgniter 4 - What will change?

CodeIgniter had, compared to Laravel, fewer chances to score with developers. However with version 4 of CodeIgniter the tide could turn!

by Manuel Wutte
Reading time 7 min
Manuel Wutte anexia blau web
Software Development
Manuel Wutte anexia blau web

As already mentioned in the last post about CodeIgniter, the framework which was originally developed by EllisLab, was adopted by the BCIT (British Columbia Institute of Technology). Just a few weeks after this acquisition, the new improved version 3.x of this framework was released. Although the framework had now a relative solid base, it still lagged in parts strongly when comparing with the frameworks of its competitors. So CodeIgniter had, compared to Laravel, fewer chances to score with developers, because the competitor frameworks' functionality and coding style were always a bit better. However with version 4 of CodeIgniter the tide could turn!

The big move

In the official CodeIgniter forum, it was already announced on 26/06/2016, that the first milestone of CI4 has now been achieved. At this time the repository was also transferred on GitHub: https://github.com/bcit-ci/CodeIgniter4

A documentation can be found here. But please be aware that these is not finished yet, and therefore it's still in partls rather sketchy. 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 exploits. The only neccessary modification on the server-side is a little change in the vhost configuration (if available or possible). The document root will no longer be placed in the root directory of CodeIgniter, but now in the public folder. Such a vhost configuraton could now look like this:

<VirtualHost *:80> ServerName codeigniter4.local DocumentRoot /var/www/vhosts/codeigniter4.local/public/ </VirtualHost>