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

Tomas Vortuba:
How to Migrate From PHP CS Fixer to EasyCodingStandard in 6 Steps
Jun 12, 2018 @ 11:16:09

Continuing on in his series of migrating your PHP syntax checking over to the EasyCodingStandard, Tomas Vortuba has a new post showing how those currently using PHP CS Fixer can make the migration over to the new tool.

We looked at how to migrate from PHP_CodeSniffer to Easy Coding Standard on Monday. But what if your weapon of choice is PHP CS Fixer and you'd to run also some sniffs? There are a few simple A ? B changes, but one has to know about them or will get stuck.

ECS is a tool build on Symfony 3.4 components that combines PHP_CodeSniffer and PHP CS Fixer. [...] But what if you already have PHP CS Fixer on your project and want to switch?

He then lists out the six steps, giving a brief description of the change and any commands of code required:

  1. From String Codes to Autocompleted Classes
  2. From notPath() to skip Parameter
  3. From .php_cs to YML Config
  4. Configuring Fixer Values
  5. From no --dry-run to --fix option
  6. From @Rules to imports

You can find out more about the EasyCodingStandard on its GitHub repository.

tagged: migrate easycodingstandard steps phpcsfixer tutorial

Link: https://www.tomasvotruba.cz/blog/2018/06/07/how-to-migrate-from-php-cs-fixer-to-easy-coding-standard/

Thomas Vortuba:
How to Migrate From PHP_CodeSniffer to EasyCodingStandard in 7 Steps
Jun 05, 2018 @ 10:43:15

Thomas Vortuba has a new tutorial posted to his site showing how to easily switch from PHP_CdeSniffer to EasyCodingStandard for enforcing the structure and syntax of your PHP application's code.

Last year, I helped Shopsys Coding Standards and LMC PHP Coding Standard to migrate from PHP_CodeSniffer to EasyCodingStandard.

There are a few simple A ? B changes, but one has to know about them or will get stuck.

Do you also use PHP_CodeSniffer and give it EasyCodingStandard a try? Today we look at how to migrate step by step.

The post then walks you through the five-step process and lists out the major changes:

  1. From String Codes to Autocompleted Classes
  2. From @codingStandardsIgnoreStart to skip Parameter
  3. From 0 and to skip Parameter
  4. From XML to YML Config Paths
  5. Configuring Sniff Values
  6. From Severity and Warning to Just Errors
  7. From Beautifier to --fix option

Each step includes either the command required, the configuration changes to make or code examples of the refactor to help illustrate the changes.

tagged: migrate phpcodesniffer easycodingstandard codingstandard syntax tutorial

Link: https://www.tomasvotruba.cz/blog/2018/06/04/how-to-migrate-from-php-code-sniffer-to-easy-coding-standard/

Andy Grunwald:
Migrate your local PHP 7.2 setup to Homebrew v1.5.*
May 01, 2018 @ 10:25:51

The OS X users out there are no doubt familiar with the Homebrew package management system that makes it easier to install and update software on your system. This includes PHP and several other related pieces of software. In this post to his site Andy Grunwald shows you how to use Homebrew to migrate your local PHP setup up to PHP 7.2.

Last week, Hans Puac, a colleague of mine, wrote a small guide into our internal company chat on how to migrate your local PHP environment on macOS to the new Homebrew version 1.5.*. The guide helped a lot of other engineers inside trivago. I thought it might help more people from the internet. I asked Hans if I am allowed to share it, and he approved. So kudos belongs to him. Here we go:

With Homebrew 1.5.0 the tap homebrew/php got deprecated. They migrated it to homebrew/core, but this is changing the installation process completely.

He then walks through the steps (complete with the commands required) to make the update happen:

  1. Cleanup (the currently installed PHP packages)
  2. Update [Homebrew]
  3. Install PHP (7.2)
  4. Verify the installation
  5. Install extensions
  6. Cleanup

He also includes a few tips to help you troubleshoot some of the common problems including wrong versions of PHP, wrong php.ini being used and a "module already loaded" issue.

tagged: php72 homebrew osx migrate tutorial process package

Link: https://andygrunwald.com/blog/migrate-your-local-php-7.2-setup-to-homebrew-v1.5./

Christoph Rumpel:
How I redesigned my blog and moved it from Jekyll to Laravel
Jan 18, 2018 @ 09:38:54

Christoph Rumpel has a post to his site sharing the process he followed in migrating his blog site from Jekyll to Laravel. Jekyll is a Ruby based static site generator rather than a dynamic solution like Laravel provides.

One of my resolutions for 2017 was to redesign my blog. One week before the new year I faced myself with the challenge and thought to myself if this was still doable. Somehow I managed it and here it is. In this article I will explain the process and show you how I redesigned the blog with Tailwind CSS and moved it from Jekyll to Laravel with keeping almost the same performance.

He then walks through the entire process, breaking it down into a few different sections:

  • How to start
  • The backend stack
  • Toughest decisions are the ones about design
  • Tailwind CSS
  • Make it fast

For each of the sections there's code, screenshots and links to other resources included.

tagged: jekyll laravel migrate tutorial backend tailwind design css

Link: https://christoph-rumpel.com/2018/01/how-i-redesigned-my-blog-and-moved-it-from-jekyll-to-laravel

Sergey Zhuk:
ReactPHP PromiseStream: From Promise To Stream And Vice Versa
Dec 07, 2017 @ 09:19:51

Sergey Zhuk has posted another article to his site covering functionality provided in ReactPHP. In this latest tutorial he covers the PromiseStream handling of the library allowing for the translation from promise to stream (and back).

One of the patterns that are used to deal with streams is spooling: we need the entire resource data available before we start processing it. One approach is to collect each chunk of data received from the stream.

But, imagine that we have some client code that wants to process some data from a file. It doesn’t care about the streams, it only needs to receive the entire data from the file. With this approach, this code should be called inside the callback for the end event of the stream. So, the client code should now about streams, events, and callbacks. But sometimes it’s impossible.

Example code is included to illustrate the problem above and an answer is provided in the form of ReactPHP promises. This allows the data to move into the promise as the data is being read from the stream's source. The tutorial goes on to talk about the functionality behind this transition including the buffer method to create the promise with chunked data, the all method to build the promise from the full data in the stream and the first method that works with events on the stream. The article then covers the reverse, showing how to pull information from a promise and push it back out to a stream via the unwrapReadable and unwrapWritable methods.

tagged: reactphp promise stream migrate read write tutorial promisestream

Link: http://sergeyzhuk.me/2017/12/07/reactphp-promise-stream/

Adam Culp:
Stop the pain, get to PHP 7
Oct 09, 2017 @ 11:21:24

In a post to his site Adam Culp makes a recommendation to all of those running their applications on older versions of the language: stop the pain, get to PHP7.

So, now you may be asking, “What does [my football story] have to do with upgrading to PHP version 7?” The answer, because many are letting the pain of moving to PHP 7 prevent them from experiencing the pleasure and rewards.

PHP version 7.0 was released almost 2 years ago. (1 year 10 months to be exact.) And many are still running PHP version 5.something. As a matter of fact, PHP version 7.0 is already going to run out of active community support in only 1 month and will only receive security fixes for another year after that.

He then talks about some of the pains that usually come with upgrading, especially when the jump is a relatively large one (like from the 5.x world). He mentions the acclamation of limitations that is all too easy to get used to with older versions. He also covers some of the pleasures that come with PHP 7 including one of the most major ones: the instance performance boost it gives most applications.

tagged: php7 upgrade pain migrate php5 version language

Link: http://www.geekyboy.com/archives/1376

Twilio Blog:
Creating a Symfony 3 Project with Basic User Handling
Aug 18, 2017 @ 09:56:26

On the Twilio blog they've posted a new tutorial from author Margaret Staples showing you how to create a Symfony 3 project with user handling along with the Friends of Symfony bundle.

User handling is a fundamental part of a ton of web projects. This post will walk through how to get setup using the Symfony 3 framework and the Friends of Symfony bundle so that your project can allow users to register, login and out, and view and edit their User profile. The steps here will serve as a great starting point for your next web project.

She then walks you through the installation of the Symfony standard edition and how to answer some of the interactive setup questions. Once that's set up she shows how to install the FriendsOfSymfony/FOSUserBundle and what configuration options need to be changed to implement it. She then shows how to update the database schema for the new user handling and how to check to be sure the login, registration and profile pages are working as expected.

tagged: symfony3 project user handling tutorial install configure migrate

Link: https://www.twilio.com/blog/2017/08/up-and-running-with-symfony-3.html

Master Zend Framework:
How to Migrate from Zend Expressive Version 1 to 2 with Command-Line Tooling
Jun 27, 2017 @ 10:43:30

On the Master Zend Framework site Matthew Setter has written up a new tutorial showing you how to migrate from Zend Expressive v1 to v2 with the help of some command line tooling support provided as a part of recent updates to the project.

In part one of this series, we started learning about the tooling support available for Zend Expressive, provided by Zend Expressive Tooling There, we learned how we can use the package to create, register, and deregister middleware, and scaffold new modules. But that's only half of what the package can do.

Here, in part two, let's learn about the other half, which removes some of the heavy lifting required when migrating Zend Expressive applications from version one to two.

He first defines some of the main differences between the two versions, a checklist of things the tooling will help you more automagically update. He talks more specifically about migration support, moving to "programatic pipelines" in Expressive v2 and scanning for deprecated error middleware. There's also information about locating the legacy request and response handling and how they're refactored to the newer format.

tagged: tutorial zendexpressive zendframework migrate version update tooling commandline

Link: http://www.masterzendframework.com/tooling/migrating-to-version-2/

thePHP.cc:
Migrating to PHPUnit 6
Feb 03, 2017 @ 09:07:28

On thePHP.cc site there's a new post sharing what you need to know about migrating your PHPUnit installation up to PHPUnit 6 from previous versions.

The first version of PHPUnit 6 was released today. Today also marks the End of Life of PHPUnit 4. What does this mean for you? The answer to this question depends on which versions of PHP and PHPUnit you currently use.

They break the reminder of the article down into three sections:

  • what you'll need to change to update from PHPUnit 4
  • what you'll need to change to update from PHPUnit 5
  • what kinds of things come with PHPUnit 6 that "you'll want to use"

This last section includes updates like the changes to namespacing, having "risky" test checking enabled by default, deprecated APIs and the ability to export a log file JUnit will understand.

tagged: migrate phpunit6 tutorial phpunit4 phpunit5 features updates

Link: https://thephp.cc/news/2017/02/migrating-to-phpunit-6

Stoyan Stefanov:
HTTPS migration: a WordPress blog hosted on Dreamhost
Jan 09, 2017 @ 09:17:27

Stoyan Stefanov has written up a post sharing the process he followed to migrate a WordPress blog to HTTPS on the Dreamhost hosting service.

Now some folks reminded me recently that the Perf calendar was not yet migrated to HTTPS... True enough. I have to do it. Eventually. In any normal situation I'll procrastinate indefinitely, but since I had more pressing things to do and "Anyone can do any amount of work, provided it isn’t the work he is supposed to be doing at that moment"... I bit the bullet.

Below are the steps that worked for me with a WordPress blog, hosted on DreamHost. The steps are still relevant to any WordPress site, just using Dreamhost as an example and since Dreamhost makes many of the steps easy.

He breaks the process down into six parts, including a bit of testing at the end:

  • Setup free SSL certificate thanks to Let's Encrypt
  • Backup all the things (or just the blog's database or just the table with the posts)
  • Search and replace internal references (images and links) WP settings
  • Redirect http to https permanently in .htaccess
  • Test/tweak?

Each step comes with the code or configuration you'll need to set up HTTPS and some screenshots where necessary, like with the Let's Encrypt setup.

tagged: wordpress migrate https blog dreamhost letsencrypt tutorial

Link: http://www.phpied.com/https-migration-wordpress-blog-dreamhost/