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

Matthew Weier O'Phinney:
Fixing Version Issues When Running Composer from a Branch
Sep 11, 2015 @ 15:55:04

Matthew Weier O'Phinney has posted an article to his site showing you how to fix version issues in branches when using Composer packages and libraries in your applications.

For the Zend Framework component repositories, we occasionally need to backport changes to the 2.4 LTS releases. This requires checking out a branch based off the last LTS tag, applying patches (often with edits to translate PHP 5.5 syntax to PHP 5.3), and running tests against PHP 5.3 and 5.4.

Of course, to run the tests, you need the correct set of dependencies installed. If you have any component dependencies, that means running a composer update to ensure that you get the 2.4 versions of those components. And that's where my story begins.

He talks about some of the issues he's come across when testing components and Composer, not understanding that the environment has changed, does not load the correct versions of the necessary libraries. He first tried to fix the dependencies himself, adjusting the version numbers required but with no luck. Finally he stumbled across something on the Composer site that helped: the ability to define a "root version" environment variable that made it adhere to the versions he needed.

tagged: composer dependency branch issue incompatible environment variable

Link: https://mwop.net/blog/2015-09-09-composer-root.html

NetTuts.com:
PHP 5.6: What's New
Oct 02, 2014 @ 15:58:59

On the NetTuts.com site there's a new article posted talking about some of the new stuff that comes bundled in PHP 5.6 (the first stable version of which was released at the end of August 2014).

It's been a long time coming, but we finally have a new version of PHP. With it comes a some nice, new features, improvements to existing features, as well as features that have been removed or marked as deprecated. Let's dive in and take a look at everything that's offered by the latest version.

There's several items on the list, broken up into various sections, each with brief explanations:

  • Backward Incompatible Changes (ex: json_decode, mcrypt)
  • New Features (including constant scalar expressions, argument unpacking, phpdbg)
  • Deprecated Features (call to static from non-static context, removal of HTTP_RAW_POST_DATA)

They also link to the list of all of the changed and new functions updated in the PHP 5.6.0 release and moving forward.

tagged: php56 new feature deprecated backwards incompatible break

Link: http://code.tutsplus.com/articles/php-56-whats-new--cms-22101

Rob Allen's Blog:
Unit testing Zend Framework 1
May 01, 2012 @ 15:54:51

Rob Allen has a new post (a quick introduction) about working with the unit tests in the Zend Framework (version 1), how to get PHPUnit working and execute the tests.

As part of our release process for Zend Framework 1.12, I've been working through the unit tests and running them on PHP 5.2.4 as it seems that recent changes weren't being tested with that version. This isn't totally surprising as Open Source contributors are, almost by definition, interested in new things and so are much more likely to be running PHP 5.4 rather than 5.2!

Since there's a compatibility issue between the tests and the current versions of PHPUnit, he shows you how to install the 3.4 version instead following these instructions. Then, to run the tests, it's a simple call to execute this PHPUnit version with options for outputting to the "standard error", setting an infinite memory limit and pointing to the tests for your component of choice.

tagged: unittest zendframework phpunit version incompatible tutorial

Link:

Sara Golemon's Blog:
Heads up, PHP 5.3's Module API is not Backward Compatible
Dec 10, 2009 @ 13:52:39

Sara Golemon has a bit of a warning for those extension developers moving between PHP 5.2 and 5.3 - the Module API isn't 100 percent compatible.

Unlike PHP, C generally resolves function calls at compile time. When you introduce dynamically loadable shared objects, the ability to know their exact address ahead of time goes out the window [...] One of the things that makes this unnecessarily slower is libraries which export a lot of symbols which aren't needed outside of the file they were defined in.

Because of some of the lazy ways of extension developers (well, some of them) there's been issues with some extensions not making things static when they should be. To counteract the problems this can cause, the PHP 5.3 developers changed the macros to expand out to static instead of const.

tagged: module api incompatible

Link:


Trending Topics: