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

Symfony Finland:
State of GraphQL PHP libraries and Symfony integrations in 2017
Nov 15, 2017 @ 11:16:39

On the Symfony Finland site, there's a post that looks at the current state of GraphQL PHP libraries in 2017 and how they are integrated with applications using the Symfony framework.

GraphQL has continued to gain momentum over the course of 2017. While it's certainly not a replacement for REST in all cases, it does provide consumers of Content APIs, etc. better ergonomics than general purpose RESTful interfaces. For PHP there are currently two popular libraries, both of which have Symfony integration Bundles.

The post starts by talking about implementing GraphQL functionality in your own application and mentions the two main libraries currently used: Webonyx GraphQL PHP and Youshido GraphQL. It goes on to talk about the integrations both of these provide as bundles and a bit about what each has to offer. The post then wraps up with a look forward to the Symfony Flex support they provide and a few links to other resources about GraphQL and its use in Symfony applications.

tagged: symfony framework graphql library bundle webonyx yushido

Link: https://symfony.fi/entry/state-of-graphql-php-libraries-and-symfony-integrations-in-2017

Joshua Thijssen:
Symfony's autowiring
Nov 02, 2017 @ 10:26:18

Joshua Thijssen has a new post to his site looking "under the hood" at Symfony's autowiring functionality used to locate and initialize services for the framework as needed.

When asking people if they use Symfony’s autowiring functionality, an often heard excuse why people don’t use it is because of all the magic that is happening during autowiring. But just like most impressive magic tricks, once explained, it all boils down to a few simple principles and Symfony’s autowiring is nothing different in that perspective. In this blogpost I will explain the new autowiring and autoconfiguration features, and why you should love them.

He starts off with an example of how to define services manually. He then explains how these services are used in the code and how to pass in arguments when fetching. He then moves on to the automatic generation of the services (the autowiring) and how the framework is "tricked" into using the namespace of the discovered service as the name. This is also used in dependency handling. The post then covers when the autowiring won't work, autoconfiguration and how to set defaults on service definitions (for arguments).

tagged: symfony autowiring tutorial indepth configuration framework

Link: https://adayinthelifeof.nl/2017/09/19/symfony-autowire.html

Asmir Mustafic:
How do I deploy my Symfony API - Part 5 - Conclusion
Oct 31, 2017 @ 12:47:25

Asmir Mustafic has finished out his series showing his method for the deployment of Symfony applications with part five sharing some additional improvements that could be made to the system created in the four previous parts.

This is the fifth post from a series of posts that described the whole deploy process from development to production of a Symfony API. This series of blog posts had the aim to show a possible approach to build a continuous integration and continuous delivery pipeline.

The continuous integration and continuous delivery process reduces bugs and makes the development simper. [...] As always happen in software development, solutions are not perfect. There is always room for improvement. Here are few examples of what could have be done better. Obviously can be done better and this are not all the possible improvements that can be done on the system.

In the remainder of the article he includes changes that could be made to the:

  • migration execution, allowing for it to be done between deployments
  • performing health checks of the API
  • Docker container placement
  • putting PHP and Nginx into the same container
  • "node draining" (removing a node from a cluster)

He wraps up the post with a mention of a tool, Kubernetes, that can help to make the configuration and management of your containers easier.

tagged: deploy symfony api tutorial series part5 conclusion

Link: https://www.goetas.com/blog/how-do-i-deploy-my-symfony-api-part-5-conclusion/

Symfony Finland:
Symfony Flex adoption picks up prior to release of 4.0 in November 2017
Oct 31, 2017 @ 09:55:14

The Symfony Finland site has a new post with a brief look at how the adoption rate of Symfony Flex has picked up with the impending release of Symfony 4 coming next month (November 2017).

With Symfony 4.0 a new standard structure for building applications is being adopted. This is known as Symfony Flex and will be the preferred way of creating applications. Symfony 4.0 is scheduled for release in November 2017, but many projects have already started adopting the new structure.

[...] In six years a lot of things have changed in the web development world, with the rise of front end driven applications, containerised microservices and more. [...] One thing that has not changed for some time is the Standard Edition itself. It has been critiqued for being enterprisey and heavy on configuration. [...] The trend was noticed by the team and in December 2016 at the SymfonyCon Berlin Symfony Flex was announced.

The post also lists out some of the projects that are already embracing Symfony Flex in their project structure including the GraphQL bundle and the PhpStorm Symfony plugin. Symfony Flex also gives developers a way to more immediately work with Symfony 4 when it is released through the same methods as now (with the 3.3 components).

tagged: symfony symfonyflex symfony4 adoption rate project november

Link: https://symfony.fi/entry/symfony-flex-adoption-picks-up

Symfony Blog:
The Symfony Community Awards are back!
Oct 30, 2017 @ 12:44:22

On the Symfony project's blog they've made an announcement about the return of the Symfony Community Awards, a way for the Symfony community to recognize those that have really helped out the community or the project in the past year.

We're very pleased to announce the opening of the Symfony Awards votes! Every 2 years, we have the pleasure to organize the Symfony Awards to reward the Symfony Community members for their involvement in the great Symfony Community. The last Symfony Awards were organized at SymfonyCon Paris 2015, this year we're pleased to organize them at SymfonyCon Cluj 2017, November 16th-17th.

Categories include: Best Blogger, Best Code Contributor, Best Evangelist and Symfony MVP of the year. Anyone can be put in as a suggestion using either their SensioLabsConnect username or full name. If someone has won in the past and is selected again, the award will go to the next deserving person in line. Voting will remain open until midnight November 10th, Paris time.

tagged: symfony community awards vote

Link: http://symfony.com/blog/the-symfony-community-awards-are-back

Symfony Finland:
Running Symfony without a web server on Docker using PHP-PM
Oct 25, 2017 @ 10:30:05

On the Symfony Finland site there's a tutorial posted showing you how to run Symfony without a web server using Docker and PHP-PM.

Docker containers have been becoming an increasingly common deployment method in the past few years. I've deployed some Node.js app in containers, which are very simple to deploy as there's a single process that's easy to run. I found running PHP to be more complex.

[...] When running Nginx and PHP-FPM you are forced to run a pair of of containers, one for PHP-FPM and one for PHP-NPM. [...] But I would rather just run a single process to run the application. This is how Go, Node.js and even .NET Core apps are deployed. Can PHP do without a middle man?

While it may not be the most performant way to run a PHP and Symfony application, the author wanted to try it out and see how difficult it might be. The code for the setup is provided and, while the end result was a bit difficult to get to, it was possible.

tagged: symfony finland webserver without docker phppm tutorial code

Link: https://symfony.fi/entry/running-symfony-without-a-web-server-on-docker-using-php-pm

Symfony Blog:
Interview with Pawel Jedrzejewski, founder of Sylius project
Oct 24, 2017 @ 13:45:01

The Symfony blog has a new post featuring an interview with Pawe? J?drzejewski, the founder of the Sylius project - an ecommerce platform based on the Symfony components.

Sylius, an e-commerce project based on Symfony components, recently released its 1.0.0 stable version. After several years of work and thousands of commits from hundred of contributors, Sylius is now ready to take the e-commerce world by storm. We chatted with Pawe? J?drzejewski, founder and leader of the project, to celebrate this milestone.

In the interview Pawe? answers questions about the project itself, why it stands out from some of the other ecommerce projects, the state of ecommerce and why they chose Symfony components as the base for the project.

tagged: symfony interview sylius ecommerce platform component

Link: http://symfony.com/blog/interview-with-pawe-jdrzejewski-founder-of-sylius-project

SitePoint PHP Blog:
Symfony Flex: Paving the Path to a Faster, Better Symfony
Oct 19, 2017 @ 13:16:52

On the SitePoint PHP Blog, there's a tutorial posted from editor Bruno Skvorc giving an introduction to Symfony Flex and how it is "paving the way" to a more performant future for Symfony.

Symfony Flex is a modern replacement for the Symfony Installer and not the name of the next Symfony version.

Internally, Symfony Flex is a Composer plugin that modifies the behavior of the require and update commands. When installing or updating dependencies in a Flex-enabled application, Symfony can perform tasks before and after the execution of Composer tasks.

The new Symfony will be called just Symfony 4, and while this tutorial will deal only with the Flex tool, it will mention some Symfony 4 upgrades as well.

The tutorial starts with some of the basics about Flex including its current development status and what kinds of things have changed from previous Symfony setups. It then walks you through the creation of a new Flex application including the bootstrapping of the application and the setup and use of application bundles.

tagged: symfony flex symfonyflex introduction tutorial bundle bootstrap

Link: https://www.sitepoint.com/symfony-flex-paving-path-faster-better-symfony/

Symfony Finland:
PHP 7.1 vs 7.2 Benchmarks (with Docker and Symfony Flex)
Oct 17, 2017 @ 11:17:25

On the Symfony Finland site there's a new post sharing the results of some recent benchmarks of the differences between running the framework on PHP 7.1 and PHP 7.2:

PHP 7.2 will be launching soon, in fact, it has already reached Release Candidate status. I was exploring Symfony Flex with Docker setup and thought I would do a quick round of tests to compare the differences in PHP 7.1 and 7.2 (RC4) regarding performance with a few benchmarks.

[...] The benchmarked application is the Symfony Flex port of the hybrid application I did back in January. The project now has the required configuration to run it with Docker, and you can find the full source on GitHub.

The post then shares some of the results and conclusions of the test runs, showing the differences between the two versions. In one set of tests, they're calling the front page controller with Twig rendering and in the other a backend controller without the display rendering. PHP 7.2 ends up performing slightly better than PHP 7.1 overall but not by very much in most cases. The more dramatic change is on the backend, though, with a good jump in performance for a Symfony Flex application.

tagged: symfony flex application benchmark php71 php72 compare results graph

Link: https://symfony.fi/entry/php-7-1-vs-7-2-benchmarks-with-docker-and-symfony-flex

Asmir Mustafic:
How do I deploy my Symfony API - Part 4 - Deploy
Oct 11, 2017 @ 10:23:12

Asmir Mustafic has posted the next part of his series covering the deployment of Symfony applications. In this latest article (part four) he focuses on some of the final steps of the deployment process.

This is the forth post from a series of posts that will describe the whole deploy process from development to production. The first article is available here, the second here and the third here.

After covering the steps 1-3 and having prepared our infrastructure, we can see how to deploy our application to production. Almost the same approach can be used to deploy not only to production but also to test environments.

He starts with the workflow for the deployment process, creating a flow where the "git push" should trigger other actions based on the branch pushed. Then CircleCI will fire off a series of jobs to handle environment setup tasks, connecting to a VPN and deploying the code. This includes a bit of preparation, credential handling and the Docker setup and push. Each step along the way also includes all of the YAML configurations you might need to replicate the deployment.

tagged: symfony api deployment part4 series docker configuration example

Link: https://www.goetas.com/blog/how-do-i-deploy-my-symfony-api-part-4-deploy/