Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Symfony Blog:
New in Symfony 4.1: Fastest PHP Router
Feb 16, 2018 @ 10:48:33

On the Symfony blog they have a post covering the result of some changes to how the framework handles incoming requests in Symfony 4: a performance and speed increase in the router making it even better than before.

Symfony 4 is the fastest PHP framework according to independent benchmarks, but we are continuously working on making it faster. In Symfony 4.1, we improved the Routing component to make it much faster when matching incoming URLs.

The post starts with a look at the two functional pieces of route handling: the generation of a URL to match and the matching the framework performs. Symfony 4 has sped things up by creating a "matcher" class during the compilation phase using some of these suggestions. The biggest change was to modify the regular expression URL matching to combine all patterns into one, reducing the number of calls to preg_match and locate the correlating route. The new routing requires no changes in your current Symfony 4 application, it just makes all of the updates it needs behind the scenes during compilation.

tagged: symfony symfony4 router speed performance regularexpression

Link: http://symfony.com/blog/new-in-symfony-4-1-fastest-php-router

Symfony Blog:
New in Symfony: Reproducible builds
Feb 14, 2018 @ 11:16:52

On the Symfony project blog there's an announcement posted about changes in the framework to allow for reproducible builds.

Reproducible builds are a set of software development practices that create "a verifiable path from human readable source code to the binary code used by computers". In other words, if you don't change the source code, the compilation result should always be exactly the same.

Explained more simply in the case of Symfony: if you build the container and warm up the cache of the same unchanged application multiple times, the result should always be the same.

The post talks about the idea of "reproducible builds" and how they should be "completely deterministic" where the end result is always the same (no random data, no auto-generates date/times). A few changes were required to the framework to ensure these builds were possible. The post lists out these updates and links to the bug reports for each.

tagged: symfony project framework reproducible builds

Link: http://symfony.com/blog/new-in-symfony-reproducible-builds

Agustín Houlgrave:
A guide to a proper PHP Console Application
Feb 08, 2018 @ 11:14:28

On his Medium.com site Agustín Houlgrave has posted a tutorial with some suggestions about building PHP console applications correctly.

Googling this topic, I could only find official documentation on Symfony’s Console Component and some tutorials on quick building, but i’d like to write about making a real scalable console application that you could use in an actual production project. I’ll explain the reasons we do each of the things.

I like to write decoupled, reusable and as raw as possible code, so we’ll try to aim on that direction. Also, we’ll take advantage of all of the new features of PHP 7.

He decided on the combination of the Symfony Console Component and the Zend Service Manager to handle the use of the decoupled components. He then gets into the installation of the required packages and the initial code to create the Symfony command. He then sets up the Composer autoloading and the "factory" configuration for the command. From there he includes the code to build out the command runner and gives an example of executing the command and the output.

tagged: console command symfony tutorial zendframework servicemanager component

Link: https://medium.com/@a.houlgrave/a-guide-to-a-proper-php-console-application-325ef677faf1

Symfony Blog:
New Core Team Member, Security Team Leader
Jan 29, 2018 @ 11:25:03

On the Symfony blog the project has made an announcement about a new addition to the Symfony team to help handle security issues around the framework: Michael Cullum

Handling security issues responsibly and transparently is key to the success of any Open-Source project. Symfony is no exception. We documented the process of our security management policy a long time ago.

[...] Today, I'm very happy and proud to announce that we are getting to the next level. Michael Cullum accepted to join the Symfony Core Team to lead the security team. He will be responsible for managing the security process.

Michael is the secretary of the PHP-FIG group, represents the PHPBB project and is a heavy user of the Symfony framework. Having Michael on the team means that there will be a central point of contact and someone whose primary role is ensuring the safety and security of the overall project and framework.

tagged: core security team member michaelcullum symfony project framework

Link: http://symfony.com/blog/new-core-team-member-security-team-leader

ZFort.com:
The Mexican Standoff of PHP Frameworks
Jan 26, 2018 @ 12:24:09

On the ZFort.com blog there's a new post that talks about the "Mexican standoff" between PHP frameworks, covering some of the background behind some of the more popular ones and some of the main differences between them.

PHP is one of the most widely known and potent programming languages used today. However, despite the popularity of PHP, there are many businesses using PHP without making use of a quality PHP framework. This approach slows production time and increases costs. A PHP framework is advantageous because it provides you with modules and codebase to help structure and accelerate the web development process.

[...] For CEOs, CTOs, product owners and those in the tech industry, choosing the right PHP framework can help cut production time and costs. However, every PHP framework is unique. [...] Given the wealth of PHP frameworks available, it is important to conduct solid research in order to find the platform that’s right for you. [We'll] take a look at three of the most popular PHP frameworks (Symfony, Laravel and Yii) and break down which is the best, and why.

The article then goes on to cover three of the more widely used frameworks:

  • Symfony
  • Laravel
  • Yii Framework

For each the author covers some of the origins of the framework and some of the things that it's best at. Following these there's a section that briefly compares them and how approachable they are for developers new to frameworks. While they all have their strengths the author recommends Symfony as the framework with "the most long term potential" over the others.

tagged: framework comparison symfony laravel yii opinion

Link: https://www.zfort.com/blog/php-frameworks-standoff/

Symfony Blog:
The end of Silex
Jan 12, 2018 @ 11:28:59

On the Symfony blog there's a quick post from Fabien Potencier (a sort of follow-up to this one) that talks about the end of Silex, a popular Symfony-based microframework, now that Symfony 4 and Flex exist.

What about Silex in a Symfony 4 world? During the last few months, and as an exercise when working on Flex, I have migrated several applications from Silex to Symfony 4. And the conclusion is that Symfony 4 feels like using Silex.

Using Symfony 4 and Flex feels as lightweight as using Silex. [...] Moving away from Silex is also made simpler as Symfony 4 almost auto-configure all your services. [...] For all these reasons, I would say that Silex is not needed anymore. So, we've decided to not support Symfony 4 in Silex, or at least not add the new features added in 3.4.

The comments on the post seem mostly supportive of the decision, realizing that what Symfony 4/Flex bring to the table all but replaces Silex anyway. A migration guide is in the works but hasn't been completed yet at the time of this posting (see this issue for the latest updates on that guide).

tagged: silex microframework symfony project symfony4 symfonyflex endoflife

Link: http://symfony.com/blog/the-end-of-silex

Symfony Blog:
The end of the Symfony Standard Edition
Jan 10, 2018 @ 11:54:34

On the Symfony blog there's a post with a major announcement for the users of the framework - the end of the Symfony Standard Edition, a release version that tried to bundle in the common tools a developer might need.

When I started to work on Symfony 2 many moons ago, I decided to create a set of decoupled components instead of a monolith framework like symfony 1. This choice was probably one of the key reasons of the immediate success of Symfony 2. [...] Of course, people don't want to assemble the components themselves when starting a new project. To fill the gap, we created the Flex was born. [...] Thanks to the new Flex approach, we've decided to not provide the Symfony Standard Edition for Symfony 4.0.

In the post Fabien talks about some of the history behind the Standard Edition including why it was made and what problems it solved. He then points out that, with the introduction of Flex, many of the issues and flexibility the SE lacked are worked out. While it is a little more complex to get started with a Flex application, the unpacking functionality helps with bringing in bundles of packages related packages without having to require each individually.

tagged: symfony standard edition endoflife end community flex symfony4

Link: https://symfony.com/blog/the-end-of-the-symfony-standard-edition

Symfony Finland:
PHP-PM 1.0 launches with Docker images and Symfony 3+ support
Jan 09, 2018 @ 09:37:01

As is mentioned in this post on the Symfony Finland site, the PHP-PM project has hit their first stable release, v1.0, that includes some nice tools as well.

Running an application server written in PHP has been feasible for some years. One of the robus mature options for this has been PHP-PM, a process manager. Now the project has reached a major milestone with the release of 1.0.

The PHP-PM team released the first stable release on 8th of January 2018. It builds on the work done for some years and it builds on ReactPHP. ReactPHP is a low-level library for event-driven programming in PHP.

PHP-PM allows creating long running PHP processes that serve applications directly instead of relying an embedded PHP (like with Apache's mod_php) or a web server with PHP process manager (as with Nginx and PHP-FPM).

Updates for this release include the addition of bridges for static handling, PSR-7 integration and version bumps for Symfony components used in the system. You can check out the full list of changes in the release notes if you want to see more. The post also links to other articles with more reading and tutorials covering PHP-PM and how to put it to use (including Docker integration and basic benchmarks).

tagged: phppm process manager stable version release docker image symfony update project

Link: https://symfony.fi/entry/php-pm-1-0-launches-with-official-docker-images

Zen of Coding:
PHP MVC Frameworks Preview of 2018 (Phalcon 3, Symfony 4, Laravel 5.x and Others)
Jan 05, 2018 @ 13:58:48

On the Zen of Coding site they've posted a look forward at versions of several popular frameworks coming in 2018. Their list includes Phalcon 3, Symfony 4 and Laravel 5.x.

It’s that time of the year again, when we take a look at the world of PHP MVC frameworks. We get ready for the trends of 2018 and plan our roadmaps. Also, we’ll take a quick detour to look at some seagues in the areas beyond PHP MVC.

Web development changes year over year, if not faster. MVC has been a revolutionary paradigm for modern web apps. It helped millions of developers build awesome applications and launch exciting startups.

The post includes a Google Trends chart showing the popularity of searches for various frameworks with Laravel, Symfony and CodeIgniter taking the top three spots overall. It then starts with a high level view of some of the recent changes and trends in several of the frameworks, moving into more detail for each (and some of "the rest" including CakePHP, Zend Framework and Yii. It then discusses microservices, how they relate to MVC and the continuing importance of backend functionality.

tagged: laravel symfony phalcon 2018 preview framework microservices mvc

Link: http://www.zenofcoding.com/2017/12/31/php-mvc-frameworks-preview-of-2018-phalcon-3-symfony-4-laravel-5-x-and-others/

Fabien Potencier:
Symfony 4: Unpack the Packs
Jan 04, 2018 @ 11:53:47

Fabien Potencier of the Symfony project has a post on his site that introduces Symfony Packs, groupings of useful packages that can enhance the functionality of your application without having to manually load each package individually.

We get a lot of positive feedback on Symfony 4. You love the new directory structure. You love the simplicity of using services without configuring anything. And you love the automation that Flex provides. It makes me happy and proud.

[...] But one issue I hear sometimes is that it is more complex to start a new project. [...] You loved the simplicity of starting a project with the Symfony Standard Edition. Is it nostalgia? Perhaps. Would it be possible to get the best of both world? Certainly!

The Packs are "metapackages" that Composer uses to bundle dependencies together that relate either in functionality or as defined by a custom configuration. The article gives an example using the symfony/orm-pack pack and talks about how you can use it as-is or you can "unpack" it into its separate packages and automatically update the composer.json with the result.

tagged: symfony symfony4 pack composer metapackage introduction

Link: http://fabien.potencier.org/symfony4-unpack-the-packs.html