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

php[architect]:
February 2016 Issue Released - "Workflow Powerups"
Feb 02, 2016 @ 12:17:53

php[architect] magazine has officially released their February 2016 issue - "Workflow Powerups" - featuring articles about tools, tips and techniques you can use to enhance your own development workflow.

This issue includes articles like:

  • "Docker for PHP" (Ben Hosmer)
  • "Software Branching Strategies: A Git Overview" (Georgiana Gligor)
  • "Extensible Applications with Symfony Event Dispatcher" (Juan Manuel Torres)

The usual columns are also back: the Education Station, Security Corner and Leveling Up. This month's free article is an interesting one for any one that's submitted to or runs a technical conference: an inside look at how the php[architect] crew makes the talk selections for their conferences. You can get more information about this latest issue and pick up a copy of your own directly from the php[architect] site for just $6.00 USD or a year's subscription for $49.00 USD.

tagged: phparchitect magazine februaru2016 workflow powerup issue release

Link: https://www.phparch.com/magazine/2016-2/february/

Speedemy.com:
Troubleshooting (Web) Application Performance Issues with Strace
Feb 01, 2016 @ 11:51:21

On the Speedemy.com site there's a post showing you how to get down to a seriously low level of processing and identify performance issues with strace, the debugging tool that helps monitor interactions between processes, the kernel, system calls, etc.

What do you do when your Linux web app starts acting out? You troubleshoot it, of course! Me too. And today I would like to talk to you about one tool that works really well with all sorts of applications and application servers – ranging from apache http server running modules (mod_php, mod_perl, etc.), to applications running in fast cgi setting or even simple single-threaded programs.

The tool I’m talking about is strace, and if you’re not familiar with it, it will be my pleasure to introduce you two.

They start off by answering the question of when you shouldn't use strace for testing (like when an application can actually be profiled properly) before shows where it can actually help. The post then briefly introduces strace and what it can do, pointing out what kind of information it can provide. From there they start in on using it to do the debugging and show examples of the output it can provide. They help you use some other command line options to refine this output into something a bit more useful and even include an awk command to narrow it down even more .

tagged: strace performance issue application tutorial

Link: http://www.speedemy.com/troubleshooting-web-application-performance-issues/

php[architect]:
January 2016 Issue Released - Front-End Polish
Jan 05, 2016 @ 12:50:47

The January edition of php[architect] magazine has officially been released: "APIs: Doorways to Your Apps".

The first issue for 2016 of php[architect] magazine is ready for download. To start off the new year, we look at solutions to help you easily add an API to an existing appliction.

This month includes articles on using Zend’s Apigility, the API Platform, adding a PHP web server to a Raspberry Pi, and Symfony’s component for command line scripts. Our columns discuss how to use Carbon for Datetime, the role of passwords in Security, finding the actual solution to problems, an interview with Jeff Carouth, and how the other ‘P’ languages have fared recently.

This issue also includes the usual columns covering handy libraries, "leveling up" as a developer and application security. You can pick up an issue of your own (or a year subscription) over on the php[architect] site.

tagged: phparchitect magazine january2016 api issue release

Link: https://www.phparch.com/magazine/2016-2/january/

php[architect]:
December 2015 Issue Released - Winter Tooling
Dec 01, 2015 @ 10:49:25

php[architect] magazine has just released their December 2015 issue, Winter Tooling, focusing on some of the great tools and libraries out there to help make your job as a developer easier.

In this issue, you’ll learn how to Profile your applications to identify bottlenecks, see how the FigDice engine offers a novel approach to templates, why you should be using the MySQL native driver, and how to use R and PHP to create data visualizations. Also inside, are a look at the power of interfaces, why validation is important in security, how to use the Plates templating engine from the League of Extraordinary Packages, and an interview with Rafael Dohms.

If you're interested to check out the magazine, be sure to read the free article first and see what you think. You can get just this issue (a digital copy) for just $6 USD or a full year subscription for just $49 USD (or a print/digital for a bit more).

tagged: phparchitect magazine december2015 tools issue release

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

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/

php[architect]:
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

php[architect]:
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

php[architect]:
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/