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

Symfony Blog:
Twig: How to upgrade to 2.0? Deprecation Notices to the Rescue
Aug 19, 2015 @ 10:55:58

The Symfony blog has posted a quick guide with a tip to upgrading to Twig 2.0 made simpler thanks to some built-in deprecation notices.

As Twig 2.0 is approaching fast now, it's time to focus on how to boost adoption of this new major version. [...] Also, the good news is that most of the time, it's possible to make your code work for both major versions (that's important for shared code like bundles). [...] How to make it easy? Like for Symfony, I've now added deprecation notices throughout the code to give Twig users an easy way to upgrade their code (this is available in the upcoming Twig 1.21 version).

The release of v1.21 comes with the deprecation notices already built-in making it easy to find the issues before making the jump up to v2.0. He also includes mentions of two other things included to make it easier: a deprecation collector to gather the issues in one place and a visitor base class diff that can make them compatible with both versions (1.21 and pre-1.21).

tagged: twig2 twig templating version upgrade deprecation notice

Link: http://symfony.com/blog/twig-how-to-upgrade-to-2-0-deprecation-notices-to-the-rescue

Community News:
PEAR 1.10.0dev1 brings PHP 7 compatibility!
Jul 28, 2015 @ 12:14:42

As was announced on both the PEAR blog and Christian Weiske's blog, the PEAR project has made a major update to add PHP7 support preparing it for the upcoming major release.

The new PEAR installer release adds PHP 7 support while dropping support for PHP 4 - 5.3. It also fixes a nasty SSL issue that made it hard to use on PHP 5.6. With the update, strict warnings about static calls to a non-static PEAR::isError() are a thing of the past.

I've just published the first preview version: PEAR 1.10.0dev1.

Upgrading your version of the PEAR installer is as simple as a call to pear upgrade specifying this dev1 release (command is included in the post). He also links to some pre-release versions of the go-pear and pear-nozlib installers.

tagged: pear php7 compatibility dev1 installer upgrade command

Link: http://cweiske.de/tagebuch/pear-1.10.0dev1.htm

PHP.net:
Release of PHP 5.4.42, 5.6.10 & 5.5.26
Jun 15, 2015 @ 14:04:37

The PHP.net site has announced the latest releases for all current major language versions with fixes including several security-related issues:

The PHP development team announces the immediate availability of [these versions]. Six security-related issues in PHP were fixed in this release, as well as several security issues in bundled sqlite library (CVE-2015-3414, CVE-2015-3415, CVE-2015-3416). All PHP users are encouraged to upgrade to [the latest version for their current installation].

As always, you can get these latest downloads from the main downloads site or windows.php.net for the Windows binaries. Other fixes can be found in the release related list in the Changelog.

tagged: language release security bugfix php54 php55 php56 upgrade

Link: http://php.net/

Knp University:
How we Upgraded to Symfony 2.7 (+ deprecation notices)
Jun 01, 2015 @ 11:17:24

The Knp University site has a new post to their blog sharing how they migrated to Symfony 2.7, the latest release of the popular PHP framework.

Symfony 2.7 - the next LTS release - came out on Saturday, with bells and whistles like 100+ new features/enhancements and a surprise new bridge component to PSR-7. So, we decided to upgrade immediately and report back. Let's go!

They walk through each stage of the process, sharing code and summaries about what changed along the way (including the update to the composer.json):

  • You need to upgrade sensio/distribution-bundle
  • You Need -with-dependencies
  • Upgrading FOSUserBundle
  • Fixing Behat 2.5

It's a pretty short list and obviously your milage may vary depending on what version you're updating from, but most recent versions shouldn't have too much trouble.

tagged: knpuniversity upgrade symfony27 guide steps fixes

Link: http://knpuniversity.com/blog/upgrading-symfony-2.7

Lorna Mitchell:
PHP7: Easiest Upgrade Yet
May 19, 2015 @ 09:11:00

In her most recent post Lorna Mitchell talks about her own experiences in getting a current application upgraded and ready to run on PHP7. It can best be summed up in a tweet from her: "Total lines of code change needed to make the @joindin API work on PHP7: zero"

With PHP7 looking increasingly stable (relatively speaking, it's still pre-alpha so it's VERY early days and anything could happen!), and work going well on the GoPHP7-ext project to get extensions converted, I have been thinking about the migration guides we'll need to help people upgrade their existing applications. To this end, I took the simplest project I currently have (http://api.joind.in) and gave it a whirl on PHP7, using Rasmus' PHP7 dev box. [...] All in all, it wasn't a great study of what kinds of things can go wrong when upgrading projects, because as far as I can tell with the test coverage that we have, it Just Works (TM).

She points out that a major contributing factor to it "just working" in PHP7 probably has to do with the few amount of dependencies. She also suggests looking at the tools you do use and see if they're already doing work to make it cooperate on PHP7 when the time comes. She describes some codebases that should "just work" with PHP7 including smaller codebases and things created with more modern tools/libraries/frameworks/etc.

tagged: php7 upgrade codebase joindin api justwork

Link: http://www.lornajane.net/posts/2015/php7-easiest-upgrade-yet

PHP.net:
Release of PHP 5.4.41 & 5.5.25
May 15, 2015 @ 11:46:34

The latest versions of the PHP language in the 5.4.x and 5.5.x series have been released - PHP 5.4.41 and PHP 5.5.25.

These releases both fix several bugs including seven security related issues around the character in a pathname, a DoS vulnerability in the multi-part form data handling and an integer overflow in ftp_genlist.

As always, upgrading to these latest versions is always recommended (especially when there's security updates involved). You can grab the latest from the downloads page or the windows.php.net site if you're on a Windows platform. For the full list of changes, see the Changelog for the matching version.

tagged: language release security bugfix php54 php55 upgrade

Link: http://php.net/downloads

PHP.net:
PHP 5.6.8, 5.5.24 & 5.4.40 Released (Security Fixes)
Apr 17, 2015 @ 09:38:18

The PHP development group has released several different versions of PHP for the 5.5.x, 5.6.x and 5.4.x series with a long list of security issues fixed in each one (fourteen in total):

The PHP development team announces the immediate availability of PHP [5.4.40, 5.6.8, 5.5.24]. 14 security-related bugs were fixed in this release, including CVE-2014-9709, CVE-2015-2301, CVE-2015-2783, CVE-2015-1352. All PHP 5.4 users are encouraged to upgrade to this version.

Other items were fixed besides the security issues, so check out the Changelog to see those few other fixes. It's highly recommended that you update your installations to these latest versions. You can grab the latest either from the downloads page (source) or Windows users can go to winodws.php.net.

tagged: language release multiple security fix changelog upgrade

Link: http://php.net/archive/2015.php#id2015-04-16-3

SitePoint PHP Blog:
Laravel 4 to Laravel 5 – The Simple Upgrade Guide
Apr 06, 2015 @ 11:49:51

The SitePoint PHP blog has posted a guide to help you upgrade from a Laravel 4 based application to the latest version, Laravel 5. Author Younes Rafie walks you through each step of the process, providing sample code and explanations of the changes along the way.

Laravel 5 is already out, but the fear of change is taking everyone. We keep hearing people complaining about some radical changes. Like, why this new folder structure? Will my application break if I do a composer update? In this article, we’re going to look at how to migrate your existing Laravel 4 application to Laravel 5 and understand the new folder structure.

he starts by helping you get Larave 5 installed and working via Composer. He then makes updates to some configuration files for his sample application (it hooks into the Google Analytics API) including the Analytics connection information. He includes changes to the route handling and moving some files around to their new locations. He also mentions the re-installation of the Illuminate/Html package as it's no longer included in the base release.

tagged: laravel4 laravel5 upgrade guide tutorial framework

Link: http://www.sitepoint.com/laravel-4-laravel-5-simple-upgrade-guide/

NetTuts.com:
What's New in Laravel 5
Feb 13, 2015 @ 10:24:47

The NetTuts.com site has a new post today sharing some of what's new in Laravel 5, the latest release of the popular PHP framework. Version 5 was announced back on February 5th.

The PHP community has recently been blessed with a new release of one of its most loved frameworks, Laravel. Version 5.0.1 is a major release, so not only are there some great new features available, but the architectural foundations of the framework have also been altered to some extent. So, without any further ado, I am going to dive right into the framework and show you all the good things the latest release has to offer.

He touches on a few of the main differences between version 5 and the previous versions including:

  • Differences in directory structure
  • How method injection is handled
  • The use of contracts (interfaces)
  • Route caching and middleware
  • Authentication changes
  • Events and commands

There's more on his list, each with a description and sometimes a bit of code to help explain the changes. Check out the full post for the remainder of the list and details on those listed above.

tagged: laravel5 framework version whatsnew update upgrade list

Link: http://code.tutsplus.com/tutorials/whats-new-in-laravel-5--cms-21842

thePHP.cc:
PHPUnit 4.5 and Prophecy
Feb 06, 2015 @ 13:56:21

On thePHP.cc blog today Sebastian Bergmann has posted about the new release of PHPUnit (4.5) and how it now comes with support for the Prophecy mocking tool.

PHPUnit has had built-in support for creating test doubles for many years. This implementation was originally inspired by the first generation of mocking frameworks for Java. Since then mocking frameworks have evolved. Modern mocking frameworks are more intuitive to use, lead to more readable code, and may even allow for a clear separation of a test double's configuration and the actual test double object itself.

Like many users of PHPUnit I am not satisfied with the API of PHPUnit's own mocking framework. This dissatisfaction has lead to the development of alternative mocking frameworks for PHP such as Mockery, Phake, or Prophecy. If I were to create a new mocking framework today it would probably look a lot like Prophecy. Which is why PHPUnit 4.5 introduced out-of-the-box support for it.

He gets into some of the basics of the Prophecy tool and how it handles mocking differently than the current internal mocking PHPUnit provides. Some code examples are included showing dummies, stubs and mocks with an example of the output when some of the "predictions" have failed.

tagged: phpunit version upgrade prophecy mock dummy stub framework

Link: http://thephp.cc/news/2015/02/phpunit-4-5-and-prophecy