Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Guide to 24 PHP Frameworks (Part 3)

DZone's Guide to

Guide to 24 PHP Frameworks (Part 3)

We continue our series on PHP frameworks by looking into several interesting options, such as Li3, Nette, Phalcon, and Pop PHP.

· Web Dev Zone ·
Free Resource

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

This blog post is the third part of "The Definitive Guide to your next PHP framework" series.

Didn't read it yet?

To have a complete understanding of this topic have a look at Introduction to PHP Frameworks and Guide to PHP Frameworks, Part 2.

Table of Contents

Li3

 Image title

As we have seen in our previous articles, several frameworks are refactoring versions or new projects heavily based on other PHP frameworks.

Li3 is no different.

It was born in October 2009, under the name Cake3, from the idea of Garrett Woodworth and Nate Abele, project manager, and developer of CakePHP. 

Built for PHP 5.3+, Li3 claims to be one of the first frameworks to bring groundbreaking technologies web developers.

This project has managed to gain several important sponsorships like Engine Yard (PaaS based in San Francisco), Ratify, and Atelier Disko.

Among its more relevant technologies, I have to mention its API, which was maybe the first API to include support for relational and non-relational databases together, and its class structure.

The structure of the class allows you to organize your project or replace and override the built-in classes in a very easy way. Its use of closures and anonymous functions also allows the developer to bind method calls.

Li3 includes MySQL, MongoDB, CouchDB, and Redis, with support for Cassandra and ElasticSearch as well as PHP ActiveRecords and Doctrine 2.

When I asked Nate Abele, Founder, and CEO of Radify, (a tech company that builds automated software and chief developer of Li₃) what he thinks about the framework and how to choose the best framework, he gave me a very funny quote:

 "That’s like asking what’s the best food. Different frameworks are for different types of apps and different ways of thinking about problems. There’s certainly some overlap, but I don’t think one could argue that a single one out of all of them is best."

Li3 is, without a doubt, a good framework. It seems to have a quite a big community around it, but, as with other frameworks, you need to step into it and see if you like it from your own experience.

Nette Framework

Created by David Grudi and then further developed by a big team, Nette is not considered a framework, but a combination of different services.

It includes:

  • Latte, a high-tech template language, definitely beats Smarty/Twig.

  • DI, a proprietary dependency container.

  • Tester, a PHP unit testing suite.

  • Tracy, a debugging tool and.

  • Dependency Injection, a PHP container for services and, of course, the open-source framework.

The framework itself is also divided into small packages, you can find:

  • nette/application

  • nette/di

  • nette/mail

  • nette/utils

Each package has its own release cycle and it's released when needed.

With these packages, you can build nearly everything: APIs, personal sites, Medium projects, etc.

Nette itself is a great framework for building anything because it has a really cool architecture. You can switch every part of its system to a different one.  For example, with a DB, you can easily use Doctrine or there is an active record layer called Nette Database. 

If you would like to create an API on PSR-7, you can! The team developed a lot of projects on PSR-7, even if Nette is not PSR-7 compatible. 

It is an MVC framework that supports PHP 5 and PHP 7.

Making use of the DRY (Don’t Repeat Yourself) and KISS (Keep It Simple, Stupid) programming principles, its core feature is an easy-to-use and fast PHP framework.

Nette has a BSD license, which imposes minimal restrictions and increases the opportunity for developers to improve the quality of the code within their app.

The Nette Framework (I mean all the packages taken together,) is currently in 2.4 mainline. Previous versions are: 2.3; 2.2l; 2.1; 2.0.  At the moment, the team is preparing Nette 3.0 with full PHP 7.1 support. But, as said, all Nette packages are PHP 7.2 compatible.

Unfortunately, even with the presence of very good docs, there isn’t a lot to say about this framework.

But it is clear that the team behind it is trying to increase the quality of the product and its ecosystem. Its open-source license is helping a lot with that.

I had the opportunity to chat with two of the most prominent people within the Nette community: Tomáš Votruba and Milan Šulc.  

Just looking at the impressive number of contributions they had on the GitHub projects you will understand that you are talking with people that know their stuff.

Due to the limited amount of new features released for Nette in the last two years, Tomáš is spending most of his time working on Symfony and writing for his blog.

An amazing post he wanted to share with us regarding this topic is a comparison among his preferred 3 frameworks:

Milan’s main goal is to improve the documentation, which is written in both Czech and English. 

His contributions to this section were huge.

He highlighted the growth that the Nette community is having, especially in the Czech Republic where the team organizes a meet up on a monthly basis called PoSobota, and once a year they gather on a summer “NetteCamp” in which they code and get to know each other.

Phalcon

Phalcon’s first and most important purpose is speed.  

Andres Gutierrez, the developer started this project by taking a completely different path from the others.

In fact, Phalcon PHP is a web server extension and is written with lower-level programming languages, like C and Zephir, which provides us the ability to develop in a higher level language and compiled the code into PHP. 

This process simplifies development, reducing coding time. 

Phalcon PHP's beta version (called Spark), was released in 2011.

The first version released November 2012.

In this release, there was a very fast ORM, cache element, and its fundamental code followed the MVC pattern.

With the following version, other features were announced, such us PHQL, which is a dialect of MySQL, that speeds up the queries and requests to the database, and Vol, a template engine.

The first version of Phalcon that supported LTS is the 3.0.0 that inter alia supported PHP 7.

A remarkable side project that arrived from the Phalcon team is Phalcon Slayer, a wrapper that reconstructs the framework supporting Composer. 

As declared by the team and emphasized in the official website,  this framework is focused on velocity and, as result, it is one of the fastest, if not the fastest, PHP frameworks.

Pop PHP

Nick Sagona is a New Orleans, LA lead developer that came up with the idea of refactoring several old PHP libraries and putting them together in an open-source project.

The first version of Pop PHP was released March 19, 2012. 

The focal point of his effort was to merge these libraries into an MVC set of components in order to create a web application in an easy way.

The second version, not supported anymore but still available, was released in July 2015 and developed to take advantage of PHP 5.4 and the use of Composer.

Version 3 released one year later had some updates from the previous version and was written to support the new features implemented in and PHP 5.6 and, later, PHP 7.

The last version now available from the official website and GitHub is 3.6.5.

This is a very good product, it was counted several times among the best PHP framework and it currently includes most of the features accessible by much bigger frameworks. These include:

  • Routing

  • Service locators

  • Event managers

  • Form generators

  • Automated emails

  • A PDF generator

  • Caching

  • Debugging

  • Logging

And I need to add Popcorn, a REST-based microframework for deploying quick web applications, to this list.

Nick was so kind to answer my questions about Pop PHP. What he said was that the project started with a small library of components that he wrote to handle the website and apps he was developing back then.

And it grew pretty quickly from there, based on expanded needs as well as keeping tabs on trends and standards in the industry. 

He surely has put a lot of personal time into it, but he added that he would love if he could have more time to market or promote this framework a little bit more.

Prado

Sometimes, projects start on the wrong foot and there is very little that you can do. Prado seems to be one of them. This project was first started by Qiang Xue, a Chinese software engineer with plenty of experience in open source software. This framework came to be realized by taking ASP.NET and Delphi as inspirations.

The first release of this product was released in June 2004 and it was written in PHP 4. For this reason, the quality of this version was very restricted and had some issues.

Qiang refactored it using the more modern PHP 5 and, with the new version, he was able to win the Zend PHP coding contest in 2004, gaining votes from a public and judges panel.

In May 2005, the team of developers decided to rewrite the framework from scratch, again, to fix a few problems found in the second version.

From version 3 on, this project became much more stable, its code was moved to Google code, and then GitHub, and this moving resulted in more contributors being able to fix the problems, thus a better product.

In October 2008, the development team released Yii, a PHP framework that succeeds Prado leaving the concept of page/events and focuses on an MVC design pattern.

Nowadays, a good amount of people are still supplying help and develop new features even though the majority of the work is now focused on Yii which I will describe in the next post.

Silex

Fabien Potencier is the creator of Symfony, one of the best and most popular PHP frameworks in this list.

But he also created Silex, and first released it in the last quarter of 2010. It is now at version 2.0.

Silex is a microframework heavily based on Symfony. It is mainly used to create small web applications and REST APIs.

Silex is available in two different types:

  • Slim, which has only a basic routing engine, a built-in security function, sessions, cookies handlers, and some other minor features, but is extremely fast and ready-to-go.

  • The second version is called fat, and as the name suggests, but it is the more packed version of the two. It includes Twig, a template engine, Doctrine (a database abstraction), and other features taken from the mother framework, Symfony.

At the moment, Silex is viewed as one of the best and fastest microframeworks, as several benchmark comparisons demonstrated over the past few years.

If you need to build a very small application or an API, spending some time learning Silex is a wise choice.

The final result will be excellent and you will get to know the basics of Symfony, which is good if you want to scale up your application.

SilverStripe

Here is another item that belongs to the CMS category, an open source software under the BSD license. SilverStripe is a very good CMS that can be used and edited as a proper framework.

The software was first developed almost 20 years ago by SilverStripe Limited, a web company initially based in New Zealand and Australia.

The development of the second version that leverages some of the new characteristics of PHP 5 was started in late 2005 and eventually released on February 3, 2007.

A huge milestone was hit in 2010 when the software was downloaded 250,000 times.

SilverStripe 3.0 and 3.1 were released in June 2012 and October 2013 and now supporting API usability, Composer, YAML, and an improved uploader feature.

A big difference from other CMSs is the clear separation between the authors that are in charge of creating content and the developers/designers that have to change the structure of the website.

This highlighted separation gives an easy-to-use interface to the authors and provides more flexibility to web developers at the same time.

It is a good piece of software, developed in PHP 5.3, using object-oriented design principles. It follows the MVC pattern and object-relational mappers as well.

Among its features, you can see a bespoke version of TinyMCE, SEO friendly URL, support for UTF-8, and internationalization as well as hundreds of modules, widgets, and themes that can be used to extend the core of the application. 

Throughout the years, it has earned trust, thanks to the good quality of its code and the several prices they have won.

Deploying code to production can be filled with uncertainty. Reduce the risks, and deploy earlier and more often. Download this free guide to learn more. Brought to you in partnership with Rollbar.

Topics:
nette ,silex ,backend ,web dev ,php frameworks

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}