Guide to 24 PHP Frameworks (Part 2)
Guide to 24 PHP Frameworks (Part 2)
In Part 2 of this series, we look at several great PHP frameworks and a few PHP compatible CRMs to help you choose the framework for your next project.
Join the DZone community and get the full member experience.Join For Free
Have you seen our HERE Twitch channel to livestream our Developer Waypoints series?
Follow the Series
This blog post is the second part of "The Definitive Guide to your next PHP framework."
Didn't read it yet? You can check it out here.
The following parts will be published during the next couple of weeks or you can click the link below to download the full version of the Kindle book "The Definitive Guide to your next PHP framework."
If you have read the first part of this article, you should be confident when your colleagues ask you what a framework is and why PHP has so many of them.
If you are new to this topic and you want to scale up your web development skills, or you are a veteran and you would like to explore more choice out there, below you will find several others framework reviews that will let you decide which one to use next.
Table of contents
I need to be honest here, this was the first framework I used, and, as they say, you will never forget your first love.
When I was first introduced to an MVC environment from PHP developers using other frameworks, it was a struggle trying to understand where to put the code, and why there was the need for that extra effort arranging PHP, MySQL, and HTML pages in different parts of the project folder.
Then I discovered CodeIgniter, specifically, I read the first 4-5 pages of its documentation.
Suddenly everything became clear and, in a couple of hours, I was able to recreate functionalities and properly divide up code using the framework, and it helped me a lot when I learned more advanced frameworks.
CodeIgniter is quite old, it released initially in 2006, but, after being taken into the stewardship of the folks at the British Columbia Institute of Technology, it still gets updated often.
In fact, at the time of my writing, the latest version (3.1.8) was released at the end of March 2018.
The most important characteristics of CodeIgniter are the lightness and the speed at which it procesess data.
It's the framework I'll be discussing in this post that looks the least like a framework.
Compared to the other PHP frameworks, CodeIgniter has a clear and easy to understand file structure, very detailed documentation, and lots of users and companies that still use it and can help provide support.
It is definitely the way to go if you feel ready and you have enough experience with vanilla PHP.
With this framework you are ready to take the step further.
Foreword: Drupal is not an actual PHP framework, it is more of an advanced CMS or, even better, a CMF (Content Management Framework).
Drupal was founded in Belgium by Dries Buytaert, who developed a messaging board to stay in touch with his groups of friends.
Its first domain was drop.org and its popularity increased so quickly that in January 2001, he decided to officially launch the website after changing its name to Drupal.
By the way, Drupal means “drop” in Dutch.
Unlike other popular CMSs based on PHP, Drupal requires more time to be fully understood.
It has a bigger learning curve, but the response of several developers was that, after a while, the flow was very smooth.
It runs on the majority of PHP web servers such as Apache, Nginx, and Microsoft IIS.
It also supports the most important databases, like MySQL, MariaDB, PostgreSQL, SQLite, Microsoft SQL Server, Oracle, and MongoDB.
The PHP code is arranged in modules, and they can be enabled and disabled depending on the user choices.
The main module that builds the heart of the framework is called core,
This core can be enlarged by installing the extension developed and available on drupal.org.
Right now for example, there are more than 38000 free modules available, thus everything you need is already there.
Like the backend, even the front-end could be improved and, just like modules, there are several themes that can be enabled.
It's also reliabile. Having been founded almost 20 years ago, there has been a lot of time to improve and create a robust and secure product.
It is also perfect for a wide range of different projects, from websites to blogs and forums to e-commerce and social networks.
They can be scaled out just by adding the necessary modules.
There is also a continually growing community that creates and deploys tons of resources on a daily basis.
In conclusion, it is a very good CMS and if you have time to to learn it, it will be time well invested.
Fat-Free PHP Framework
Fat-Free is a micro-framework created by Bong Costa, a Filipino web developer and consultant.
As you can probably glean from the name, the key to a micro-framework is in its size.
It consists of only the bare minimum code that allows your project to run without adding any unnecessary structure.
There are multiple advantages in using this kind of skeleton.
The weight of the project. In fact, Fat-Free is less than 55kb, and it has a very easy learning curve. For the developer, this means no wasting time learning how things work and so you can put all your time into coding.
Fat-Free requires PHP 5.3 or higher and supports both SQL and NoSQL databases. It also has an ORM built-in.
Among the key features, it allows routing and has a good template engine connected with the views.
Even though there are good reasons to use a micro-framework, you have to consider that this could be seen as a limitation when the project needs to be scaled or if there is more than one web developer working on it.
Another little limitation is that Fat-Free does not come with a defined structure but you need to create it according to your needs, and this could be intricate if at the beginning.
One of the most interesting (in my opinion) PHP frameworks available is Fuel.
It was created by several web developers with lots of years working and building PHP frameworks — Dan Horrigan and Philip Sturgeon (famous for their contributions to CodeIgniter), among them.
Fuel seemed to be a good mixture between CodeIgniter 3.x and Kohana 2.x taking the best parts and improving on each of them.
The result was a very fast structure to work with.
It was designed to have full support of the hierarchical Model View Controller principle, which means that the selected code can be used in several pages across the entire project — just think of a shopping cart or blog posts.
Let's forget the presence of the presentation model, also called ViewModels. It basically adds another level between the views and the controllers.
The idea of the file structure for FuelPHP was copied from Kohana and improved upon, a wise use of namespaces and autoload which allows the calling of class to happen clearly faster than the parents.
It also came with two packages pre-installed, ActiveRecord and Oil, the latter of which is a very useful command line utility.
FuelPHP has been developed by people that surely know what they are doing and it took one of the best features of Kohana (its file structure) and mixed it with CodeIgniter, which, as seen above, has been a masterpiece for a decade.
But now, with the release of PHP 7, it's starting to show its age.
The downside of it may be that the community has never grown that much, thus it is very difficult to find the support and answers to questions from other developers.
Phil Sturgeon was really kind to reply to my email when I asked for information about this framework.
He said that the peak of the effort of the development team was in the years 2011-2012, and even though the code is still available online, the project was officially abandoned in 2015.
He also linked me to a blog post he wrote, dated January 2011, in which he was introducing FuelPHP to the world.
I highlighted what I thought was the most important information above, but if you want to check his post out, here is the link:
Another external reference he sent me was a blog post written by Dwayne Charrington, in which he carefully compared the main characteristics of Fuel and CodeIgniter.
Phil never rests, and he gave me a list of several projects he is currently working on. He is now mainly working at Wework, a New York based company.
Among his projects you can find:
All of them have repositories on GitHub.
He is creating tooling to help users with API specifications and API interactions in general.
Here is a link to a few articles for whoever wants to learn more about the topic.
Another fascinating framework, at least for its composition, is Gyroscope.
Developed by Antradar, it has been around for a while, in fact, its first release is dated to more than 9 years ago.
It supports 5.4 and the newest versions of PHP and, among its pros, there is the size, which is less than 200 KBs and thus, its speed.
Unlike the other frameworks we have just seen, Gyroscope uses anLCHH architecture and not the more popular MCV.
In this architecture, a div tag with a unique id is populated using previously chosen data.
This data invokes the client that sends an AJAX request to the server side. Then the PHP does its stuff like create, delete, etc., and updates the view.
This makes the path equal to an HTTP request which is good for performance and debugging.
Some problems you might encounter if you choose to use Gyroscope is that there is low or no support at all, the documentation in the official website is out-of-date, alongside a community that has never really grown.
My last thought is that if you want to explore more in the PHP world and learn about LCHH, it is fine to give it a shot.
But, at the same time, be aware that there are more advanced frameworks out there.
Released in July 2003, Jamroom is another CMS.
Now in its sixth version, it was developed by Talldude Networks and is licensed with a Mozilla Public License.
Jamroom is a very different product from the others you are seeing here.
It is composed by a Module architecture that permits the structure to increase or decrease its functionality.
The other part of Jamroom is its skin, which allows you to change the features and look of the website.
Everything inside it is either a module or a skin.
A relevant event is the fact that it ran on Flash until version number 5, which carried some issues regarding mobile responsiveness.
Nowadays, the problem has been successfully solved and all the multimedia data uploaded is then converted and available in several formats.
Here is another Content Management Framework.
This is an LGPL licensed project, which means that the external developers can enhance the code by adding and improving implementation and features.
Kajona was created in 2004. The second version was deployed in 2005 immediately followed by the version 2.1 in 2006. At the moment, this CMS is a sound framework arrived at its sixth version.
The system is separated it two main sectors: the backend, which is the part used to maintain the website, and the portal, which is used to show the content.
This portal has built-in in-page editing functionality.When hovering on an editable element it is possible to update its contents and the result will be seen on the fly.
From a web developer’s point of view, the architecture looks like a normal MVC with the three distinct layers.
Kajona supports MySQL, MariaDB, PostgreSQL, Oracle, and SQLite. It also provides a template engine to render the content in the front-end.
To sum up, this is a very solid CMS built in a way that its code can be tweaked and edited in a very smooth way.
It is not mainstream, so you will not find a lot of support, but it comes along with a good documentation.
If you need a similar product and you do not want to use WordPress, it is worth giving a shot.
I have already mentioned this framework when I was describing FuelPHP above.
Kohana was, yes I wrote was, a very good and a very unlucky framework.
Its development started at the end of May 2007, from the plan of some CodeIgniter members and its first name was BlueFlame.
The first official version was released a couple of months later, without any documentation.
After some scrambling by the internal team, the second version was released in November of the same year. At that time it was written in PHP 5.0.
The third and last version of this PHP framework was released officially on September 9, 2009, and the last update, 3.3.6, was released July 25, 2016.
Kohana was formally deprecated on July 1, 2017.
Several intents of revival have been tried, at the moment the closest heir is Koseven.
I have spoken with Chema Garrido. He is the frontman of Koseven and he said that the framework is a compatible replacement of Kohana, which allows users that do not want to migrate for Kohana to keep the application bug-less and up-to-date thanks to post security fixes and compatible with the latest versions of PHP.
He also advised using a more modern product; like me, he is a fan of Laravel, which you will read more about it in the next section.
Here is the showpiece of the list.
From my point of view, Laravel is without any doubt the most interesting framework for PHP.
Its growth and the list of features are simply unbelievable.
Created by Taylor Otwell as an experiment of improving CodeIgniter, Laravel's first release occurred on June 2011.
It wasn't a real MCV because of the lack of controllers but had dozens of internal features such as authentication, sessions, routing, and localization.
Several enhancements were brought by the second version of Laravel, which finally supported controllers, IoC principles, and a blade templating system that permits the developers to better integrate PHP with the view.
Laravel 3 was released in February 2012 and, in a certain wa,y it could be considered a small breakthrough.
Tthe main features are: Artisan, a brand new CLI (command line interface), plus database migration, events handling and bundles, and a packaging system.
In May 2013, Mr. Otwell released Illuminate, the nickname chosen for Laravel 4.
After so many successful years, it was completely rewritten and distributed as a package via Composer.
With the fourth version of Laravel, developers could really certify that the project was now growing at the point to be world class.
Among its new features, I'd like to highlight database seeding, which allows for the populating of databases, support for different kinds of emails, soft deletion, and message queueing. Not to mention the publication of a release scheduled for the minor version.
Basically, from this version on, there will be a new minor version every six months or so.
Laravel 5 made its appearance in March 2015. This version includes Flysystem for remote storage, Elixir to handle package assets, Socialite for authentication, and Scheduler for... guess what? Scheduling tasks!
At this point, Laravel was already the most popular PHP framework.
The first version with long-term support (LTS) was Laravel 5.1. The plan, then brought in again with version 5.5, was to support security and bug fixes respectively for two or three years.
At the point of writing this article, Laravel is on version 5.6 , which was officially been released on February 7, 2018.
Besides the unbelievable high quality and hard work from the creator and the contributors, I think that Laravel changed how web developers write and think about their job.
For example, using a feature like Eloquent ORM (Active Record) presenting database tables as classes makes the developing process, thus the life of developers, so much easier.
Attending Laracon in either the US or Europe is something that most developer have dreamed of at least once.
Laravel News will keep you and your colleagues informed about what is happening around this framework, and last, but not the least, Laracasts with thousands and thousands of minutes of free videos edited by Jeffrey Way, an incredible developer former top-mind at Envato tuts+.
As you can se,e choosing Laravel means choosing the entire ecosystem.
Join a huge community of developers tha,t even if you do not realize it, will make your job better in the years to come.
To Be Continued...
Now It's Your Turn
I hope you enjoyed my framework comparison.
The next part will be published soon.
But now, I want to hear from you:
Which PHP framework has intrigued you the most? Are you going to try one of these listed above?
Published at DZone with permission of Nico Anastasio . See the original article here.
Opinions expressed by DZone contributors are their own.