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

Fabien Potencier:
Symfony 4: Performance out of the Box
Dec 12, 2017 @ 13:48:07

In a quick post to his site Fabien Potencier (of Sensio Labs and the Symfony framework) has a post sharing some information around the performance of Symfony 4 and what kind of speed you can expect in your applications based on it.

Performance is an interesting and sensitive topic. Suffice to say that most projects should not care too much; modern PHP frameworks are fast enough for most use cases and projects. And PHP 7 performance improvements help a lot as well. But people like to compare frameworks, and I guess performance is one way to do so.

What about Symfony 4? During its development cycle, we did some nice performance optimizations: mainly to improve the router and container speed. But several non-related changes in Symfony 4 also help with performance... Your mileage may vary depending on your specific project of course.

He talks about some of the testing and evaluation that's already been done on "Hello world" script performance but points out that this isn't a very real world situation. He shares these metrics, however, to at least give a baseline to compare it against previous Symfony versions. The post also links to another resource that shares these and other benchmarks related to various PHP projects.

tagged: symfony4 performance symfony framework version benchmark

Link: http://fabien.potencier.org/symfony4-performance.html

Paragon Initiative:
The 2018 Guide to Building Secure PHP Software
Dec 12, 2017 @ 12:16:13

On the Paragon Initiative blog has a new post that shares some of their own tips and tricks of how to building secure PHP applications moving forward in to 2018.

As the year 2018 approaches, technologists in general—and web developers in particular—must discard many of their old practices and beliefs about developing secure PHP applications. This is especially true for anyone who does not believe such a feat is even possible.

This guide should serve as a complement to the e-book, PHP: The Right Way, with a strong emphasis on security and not general PHP programmer topics (e.g. code style).

The guide covers a wide rang of topics that can help you secure your applications (and not just PHP ones either) including:

  • working with security headers
  • safely handling file uploads
  • effective password hashing
  • general-purpose cryptography
  • searchable encryption
  • event logging with Chronicle

Each item in the list is a link to another part of the guide where the topic is discussed. In each there's plenty of good information about prevention and implementation as well as links to other tutorials and packages that can help.

tagged: secure application development guide 2018 introduction

Link: https://paragonie.com/blog/2017/12/2018-guide-building-secure-php-software

Laravel News:
Laracon Online 2018 Early Bird Registration Reminder
Dec 12, 2017 @ 11:56:16

On the Laravel News site they've posted a reminder about the Early Bird registration deadline for the 2018 edition of the Laracon Online conference.

As the year comes to a close, remember that for the next 23 days, you can still buy tickets to Laracon Online 2018 for $12 (regularly $25). Tickets will go up to $25 on January 3rd, which is still a great deal for the all-star speaker lineup planned. Grab tickets today before the busy rush of the holiday and new year.

Tickets are only $12 USD at the Early Bird pricing and the conference will be happening February 7th, 2018 beginning at 10am. Speakers include several of the Laravel regulars like Adam Wathan, Chris Fado, Matt Stauffer and, of course, Taylor Otwell. You can find out more information about the conference and pick up tickets of your own at the Early Bird price (while it lasts) on the Laracon Online website.

tagged: laracon online 2018 earlybird ticket registration reminder

Link: https://laravel-news.com/laracon-online-2018-early-bird-reminder

24 Days in December:
Giving back to PHP
Dec 12, 2017 @ 10:29:43

On the "24 Days in December" advent calendar there's an article posted from Kalle Sommer Nielsen that talks about some ways that you can give back to PHP including documentation updates, contributing to the core code and just helping out the community in general.

PHP has a tremendous community behind it, that community consists of you and me, and millions of others that help promote PHP by continuing to develop awesome applications that power some of the biggest websites in the world, but within this community exists a relatively small community that actively develops PHP, such as making it run on your favorite platform or making your favorite extensions compile and work or even keeps the documentation up-to-date. Today I want to dwell into that community, and perhaps giving you flavor enough to contribute back to PHP with code.

The article suggests several places you can give back including:

  • updating and adding changes to the PHP manual documentation
  • participating in the various project mailing lists
  • reviewing pull requests on the project's GitHub repository
  • writing tests for the untested parts of the language

Kalle wraps up the article talking about his own experience with the language over the years and how it ended up that he was the one to remove register_globals from the language one day.

tagged: give back contribute language opinion 24daysindecember

Link: https://24daysindecember.net/2017/12/11/giving-back-to-php/

Community News:
Latest PECL Releases (12.12.2017)
Dec 12, 2017 @ 08:05:02

Latest PECL Releases:

  • stackdriver_debugger 0.0.2
    Fix windows build configuration

  • opencensus 0.1.0RC2
    RC1 for alpha release. - Refactored internal data structures to match OpenCensus models - Supports creating detached spans. - Add support for annotations, message events, and links.
  • stackdriver_debugger 0.0.1
    First dev release
  • opencensus 0.1.0RC1
    RC1 for alpha release. - Refactored internal data structures to match OpenCensus models - Supports creating detached spans. - Add support for annotations, message events, and links.
  • redis 3.1.5RC2
    phpredis 3.1.5RC2

    This is interim release which contains only bug fixes.

    • Fix segfault when extending Redis class in PHP 5 [d23eff] (Pavlo Yatsukhnenko)
    • Fix RedisCluster constructor with PHP 7 strict scalar type [5c21d7] (Pavlo Yatsukhnenko)
    • Allow to use empty string as persistant_id [344de5] (Pavlo Yatsukhnenko)
    • Fix cluster_init_seeds. [db1347] (@adlagares)
    • Fix z_seeds may be a reference [42581a] (@janic716)
  • protobuf 3.5.0.1
    GA release.
tagged:

Link:

Matthieu Napoli:
Organizing code into domain modules
Dec 11, 2017 @ 12:57:01

In a post to his site Matthieu Napoli shares some recommendations about how to organize the code in your application using a "domain modules" approach. This is an organization method that relates the code based on functionality it relates to rather than the type of object it is.

We recently discussed 2 topics seemingly unrelated with my colleagues at Wizaplace: how to organize code [and] how to organize teams.

Regarding “how to organize teams”, we were discussing Spotify’s Feature teams. In a “classic” organization, teams are usually formed by grouping people based on their job title. [...] But in a “feature team” organization, teams are organized… by features. [...] The pros of this kind of organization are numerous and I do not intend to go over them here. But what does this have to do with code organization?

He starts with the "classic" code structure - organized by each item's type (ex: Entity, Service, etc). He then suggests reorganizing it move by what it does in the application, namely which module it belongs in best. He briefly touches on dependencies, "agile design" and the differences between a normal "product" and a "product" in e-commerce. He then applies these ideas and shares a domain organized directory structure, trying to reduce the overall complexity of the structure and the overall cohesion of the codebase.

tagged: domain module organization code directory structure tutorial

Link: http://mnapoli.fr/organizing-code-into-domain-modules/

Laravel News:
Creating Your Own PHP Helpers in a Laravel Project
Dec 11, 2017 @ 11:16:36

The Laravel News site has a quick post sharing a helpful topic for the Laravel users out there. In the tutorial they show how to create custom helpers for use across the entire application in any scope.

Laravel provides many excellent helper functions that are convenient for doing things like working with arrays, file paths, strings, and routes, among other things like the beloved dd() function.

You can also define your own set of helper functions for your Laravel applications and PHP packages, by using Composer to import them automatically.

If you are new to Laravel or PHP, let’s walk through how you might go about creating your own helper functions that automatically get loaded by Laravel.

The tutorial starts off by recommending the placement of the custom helper file and how to ensure it's autoloaded when the application is bootstrapped. It then covers the creation of the helper functions including the use of if checks to ensure there's not a function naming collision. Finally the post includes an example of a helper file, sharing the creation of two methods: show_route and plural_from_model. The post ends with a look at packages and how to include helper files inside of them for use in your application.

tagged: helper laravel tutorial introduction project file autoload

Link: https://laravel-news.com/creating-helpers

Gonzalo Ayuso:
Authenticate OpenUI5 applications and Lumen backends with Amazon Cognito and JWT
Dec 11, 2017 @ 10:26:21

On his site today Gonzalo Ayuso has a tutorial posted showing how to create authentication in OpenUI5 applications with the help of Lumen, Amazon Cognito and JWTs.

Today I want to create an UI5/OpenUI5 boilerplate that plays with Lumen backends. Simple, isn’t it? We only need to create a Lumen API server and connect our OpenUI5 application with this API server. But today I also want to create a Login also. The typical user/password input form. I don’t want to build it from scratch (a user database, oauth provider or something like that). Since this days I’m involved with Amazon AWS projects I want to try Amazon Cognito.

He then walks through the Cognito service and what it has to offer including user management and authentication handling. He starts with the OpenUI5 side, creating the basic application and login handling via the Congnito Javascript SDK. He then modifies this with some basic user handling and creates the view for the login form. He also includes functionality for password resets and the code required to inject the JWT into every request post-authentication.

tagged: openui5 application tutorial authentication amazon cognito lumen backend

Link: https://gonzalo123.com/2017/12/11/authenticate-openui5-applications-and-lumen-backends-with-amazon-cognito-and-jwt/

Dhurim Kelmendi:
SOLID Principles made easy
Dec 08, 2017 @ 12:55:13

In a post on the Dev.to site Dhurim Kelmendi shares an introduction to the SOLID principles of software development, a set of guidelines that can help to make your software more robust, flexible and testable in the long run.

This article aims to give a solid explanation of SOLID Principles and give some insight on their benefits and potential issues when applying them. Let’s go through each of them briefly.

He then goes through each of the principles and describes the basics behind them:

  • Single Responsibility Principle
  • Open-Closed Principle
  • Liskov Substitution Principle
  • Interface Segregation Principle
  • Dependency Inversion Principle

The post isn't language specific so you won't find any code examples but it is a great introduction to the principles for those that are just starting out.

tagged: solid development principles introduction easy

Link: https://dev.to/dhurimkelmendi/solid-principles-made-easy-1pg

Joey Masip Romeu:
Namespaces and organizing business logic services in Symfony
Dec 08, 2017 @ 11:04:35

In a post on his Medium site Joey Masip Romeu shares some suggestions about how you can organize your business logic in a Symfony application with some simple namespacing and service definitions.

I want to talk about namespacing services in Symfony, specifically Symfony3.

These are exciting times, Symfony 4 is just round the corner?— -coming out on November 30th? - ?so this blog post might be irrelevant soon! Nevertheless, concepts are still the same so let´s get into it!

He offers three "rules" that he and his team at SlowCode have defined to help with their own organization:

  • using a folder for logic services
  • using a folder for the domain name
  • using . for folder separation and _ for word separation

Code and configuration examples are provided for each suggestion helping to illustrate the point. He ends the post mentioning public and private services and how they're changing in upcoming Symfony releases.

tagged: namespace organize business logic symfony rule domain

Link: https://medium.com/@joeymasip/namespaces-and-organizing-business-logic-services-in-symfony-d80452adc4f7