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

Joshua Thjissen:
Symfony, Xdebug, and maximum nesting level issues
Nov 18, 2015 @ 10:53:45

In this new post to his site Joshua Thjissen has shared some of his discoveries with Xdebug, Symfony 2 and problems with maximum nesting levels of objects in his testing.

Here you are, developing your code based on the Symfony2 framework. Creating a form here, add a Twig template there, until suddenly, boom! Your site doesn’t work anymore, and all the info you can find in your PHP logs is [an error about the maximum function nesting level being reached.

[...] What just happened? Did I create some kind of recursive function I wasn’t aware of, did somebody commit code that I accidentally pulled? Fortunately for us developers, there is a quick way to deal with this: google it...

According to the information he found via his search it's a common issue and can be "fixed" by bumping up the max_nesting_level to a higher value. He could have stopped there but he wanted to explain why this problem happened, what the nesting is all about, how it relates to the limitations of XDebug and why Twig could cause problems with it.

tagged: symfony2 xdebug maximum nesting level issue stack trace twig

Link: https://www.adayinthelifeof.nl/2015/11/17/symfony-xdebug-and-maximum-nesting-level-issues/

November 2015 Issue Released - New Horizions
Nov 02, 2015 @ 12:29:50

php[architect] magazine has officially released their November 2015 issue: New Horizons:

We’ve just published the November issue of php[architect] magazine. With the release of PHP7 scheduled for this month, we take a look into what new features the language has to offer.

In this issue, you’ll learn about PHP 7 changes including errors that now are Exceptions and Scalar Type Hinting, writing clear PHP. We also share how to use RabbitMQ to implement a service oriented architecture and have tips for running a PHP user group.

Also, learn how to assess exploit risk in our new Security Corner column, how to write a web scraper with Symfony, an interview with Nate Abele, and more.

They're also offering an article for free if you'd like to get a sampling of the quality of the magazine. You can pick up your copy, either print, digital or both, directly from the php[architect] website.

tagged: phparchitect magazine november2015 horizions issue release

Link: https://www.phparch.com/magazine/2015-2/november

October 2015 Issue Released - Integrating Extensions
Oct 01, 2015 @ 11:12:46

The php[architect] magazine has released their latest edition, their issue for October 2015 - "Integrating Extensions":

This issue shows you how to use Solr search directly from PHP and put it to good use, explains how PHAR files work to bundle PHP applications in a single file, and provides a case study in using libfann from PHP to create and train a neural network.

Also, you can read up on how to prepare for PHP 7, learn PHP type casting peculiarities, migrate from WordPress to Sculpin, a chat with Stefan Koopmanschap, and more.

This month's issue also includes a free article so you can get a sampling of the magazine: Casting Tales in PHP. You can pick up just this issue or grab a year long digital/print/combo subscription directly from the php[architect] website.

tagged: phparchitect magazine october2015 extensions issue release

Link: https://www.phparch.com/magazine/2015-2/october/

Matthew Weier O'Phinney:
Fixing Version Issues When Running Composer from a Branch
Sep 11, 2015 @ 10: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

September 2015 Issue Released - Security Boot Camp
Sep 02, 2015 @ 12:19:02

The latest issue of the php[architect] magazine has been released for September 2015. In this latest issue they focus on security in PHP along with the same columns you know and love.

In this issue, we have an overview of the various techniques that malicious users can use to attack your application, a deep dive into how passwords can be stored securely and how PHP’s built in password functions make this easier, a look at how to setup a PHP based Intrusion Detection System, and how to use PDO to guard against SQL injection attacks

Elsewhere, there’s a look at how to think like a functional programmer, an introduction to using Sculpin for generating a static site, an interview with Elizabeth Naramore, and more.

This month's issue includes articles like:

  • Basic Intrusion Detection with Expose (Greg Wilson) (read this one free here)
  • Keep Your Passwords Hashed and Salted (Leszek Krupi?ski)
  • Leveling Up: DeLoreans, Data, and Hacking Sites (David Stockton)

...as well as the "Education Station", "Community Corner" and "finally{}" columns from returning authors. You can purchase your copy of this month's issue directly from the php[architect] website either as a single issue or as a part of a subscription.

tagged: phparchitect magazine sept2015 security issue release

Link: https://www.phparch.com/magazine/2015-2/september/

BitExpert Blog:
Running pdepend on PHP7
Aug 18, 2015 @ 09:57:19

On the BitExpert blog there's a post that shows you how to use the pdepend tool on PHP7, an automated tool that shows you the "quality of your design in the terms of extensibility, reusability and maintainability".

Being a good citizen of the PHP community we do test out internal libs against the current PHP7 codebase. So far we had no issues but then at one day one of our Jenkins PHP7 jobs failed. After investigating a bit it turned out that the problem was not part of our codebase but part of of pdepend. The pdepend process died with the error message that "T_CHARACTER and T_BAD_CHARACTER are no longer defined" which is true. The error was already reported as an issue on Github.

Unfortunately, as the problem here is a change to the core PHP language itself, there's not much of a workaround other than to just not run those certain jobs. He outlines how they handle detecting the tests that have problems, but only when run on PHP7. This allows them to run all of the tests and allow the automated system do to its work. When/if the problem is fixed in pdepend, all that's needed is to remove this one check and they're good to go.

tagged: pdepend phpdepend php7 skip test version error github issue

Link: https://blog.bitexpert.de/blog/running-pdepend-on-php7/

June 2015 Issue Released - APIs (and it's free!)
Jun 02, 2015 @ 13:48:38

php[architect] has a new post about the release of their latest issue (June 2015) - "APIs" - and how it's been made free for download.

That's right-thanks to Nexmo, June's issue on APIs is free of charge for the month! [...] The promise of Application Programming Interfaces (APIs) is really bearing fruit in today's Web. Of course, we are not talking about internal APIs but of HTTP-based ones that allow us to interact with external systems-whether its saving or searching images in Flickr, getting weather conditions, or transcoding video. For many tasks, if you sign up to use the right APIs, you can build a fully functional application by writing PHP scripts which coordinate the workflow and communications between APIs.

This issue includes articles like:

  • "SPOIL Your Users with Great Helper Libraries" (Keith Casey)
  • "High-Performance PHP APIs" (Simone Di Maulo)
  • "Putting the Pieces Together: Building APIs with Aura (and Other) Libraries" (Ian Littman)
  • "The API Toolbox" (Tim Lytle)

If you've ever been interested to see what php[architect] is all about or want to find out more about making and working with great APIs, be sure to grab your free copy today!

tagged: phparchitect magazine june2015 issue release api free nexmo

Link: http://www.phparch.com/2015/06/june-issue-on-apis-free-download/

Blackfire.io Blog:
How Blackfire leverages Docker
May 01, 2015 @ 10:08:34

The Blackfire.io PHP debugging service (from SensioLabs) has a new post to thier blog today talking about how the service makes use of Docker to build the environments for testing out their users' code.

As you may know, Blackfire was represented at the SymfonyLive conference in Paris. During this event, several people came to us and asked how we use Docker at Blackfire.io. One of our goals is to make profiling straightforward for anyone, and it means that we need to be able to easily test our product on a lot of different platforms. And Docker gives us the ability to spin up new containers in milliseconds.

Moreover, our website relies a lot on different tools, so containers can also help us reach an iso-production development environment. But Docker is only available on Linux and a big part of the Blackfire's team is using MacOS X. So how one using MacOS X can use the best of both worlds?

The post goes on to talk about their use of the boot2docker tool and how they can use it to help with the environment customization most developers want out of their testing. They show how it updates the network settings, works with file sharing, allows for multiple domain names/containers and solutions to some other common issues including no container access, no name resolution and a "bonus" section with a Skydock plugin for custom DNS naming.

tagged: blackfireio docker example common issue boot2docker

Link: http://blog.blackfire.io/how-we-use-docker.html

April 2015 Issue Released - Front-End Polish
Apr 14, 2015 @ 11:05:47

php[architect] magazine has officially released their April 2015 edition - "Front-End Polish".

It’s safe to say that a majority of PHP programmers prefer working on “back end” code. Many interesting problems live in that domain. But we can’t forget that the front end—usually HTML, CSS, and JavaScript—is where users will interact with our applications. The joy or frustration they experience trying to get a task done affects their perception of how good (or poor) your solution is for a long time. Even if you don’t want to be a front end designer or developer, you must be familiar with User Experience and the technologies used in the user interface (UI) to understand how people will use it, to help reduce sources of frustration, and to prevent errors.

Articles in this month's issue include:

  • Object Oriented JavaScript (Part the Second)
  • The Browser Capabilities Project in 2014
  • UX Without the Process
  • PHP Conference Newbies 101

Head over to the php[architect] website to pick up a (print or digital) copy of your own!

tagged: phparchitect magazine april2015 frontend issue release

Link: http://www.phparch.com/magazine/2015-2/april/

March 2015 Issue Released - DB Migration
Mar 16, 2015 @ 12:50:49

php[architect] magazine has released their March 2015 edition of their magazine - DB Migration:

Because databases store the data our applications, they need proper care and feeding too. In “DB Migrations”, David Berube shares what he’s learned to properly design your databases, Harrie Verveer looks at “Database Versioning with Liquibase”, and Patrick Schwisow shows you how to consolidate Doctrine Migrations that have gotten unwieldly.

Other topics included in this month's edition include a "deep dive" into PHP extensions, object oriented Javascript, bitwise math and much more. You can pick up your own copy - either virtual (PDF) or in print - from the php[architect] website.

tagged: paprchitect magazine march2015 issue release db migration

Link: http://www.phparch.com/magazine/2015-2/march/