2015年2月28日星期六

Community News: Packagist Latest Releases for 02.28.2015

Recent releases from the Packagist:

2015年2月27日星期五

Site News: Popular Posts for the Week of 02.27.2015

Popular posts from PHPDeveloper.org for the past week:

Community News: Packagist Latest Releases for 02.27.2015

Recent releases from the Packagist:

Derick Rethans: Xdebug 2.3: Moar var_dump()


Derick Rethans has a new post to his site starting a series of posts about the new features of Xdebug 2.3. In this new post he talks about an improvement that's been made to the output provided by var_dump with more information than before.



One of the new features relates to one of the first things that I added in the original Xdebug: making the var_dump() output "pretty". Xdebug replaces PHP's standard var_dump() function with its own version, as long as the xdebug.overload_var_dump setting is not set to 0. [...] Xdebug 2.3 enhances the overloading of var_dump() with the inclusion of the file name and line number where var_dump() is called at. This has been a long standing feature request.


He provides a few sample screenshots comparing the old and new output formats and mentions another handy setting, xdebug.file_link_format, that makes the resulting filename a link in a browser and lets you customize the format.


Link: http://derickrethans.nl/xdebug-2.3-overload-vardump.html

Laravel News: Homestead Now With Blackfire Support


As is mentioned in this new post to the Laravel News site, the Homestead development environment now comes with support for the Blackfire.io profiler.



Blackfire Profiler by SensioLabs automatically gathers data about your code's execution, such as RAM, CPU time, and disk I/O. Homestead makes it a breeze to use this profiler for your own applications. All of the proper packages have already been installed on your Homestead box, you simply need to set a Blackfire ID and token in your Homestead.yaml file


With the configuration set up, the only installation the user needs to make is setting up the companion extension (Chrome) for your browser.


Link: https://laravel-news.com/2015/02/homestead-now-with-blackfire-support/

Snack Overflow: Unit testing static calls without refactoring the world in php


The "Snack Overflow" blog (from tech.graze.com) has a recent post sharing some suggestions to help unit test static calls without having to "refactor the world" away from them.



Imagine you have a situation [using a static method call] in some legacy code. Currently we can't unit test this as we can't mock out the doSomethingElse() call. So what do we do? Well we have two options really [...] neither of which is very appealing. [...] There is, however, a third option that gains us the ability to unit test Foo without having to touch Bar at all.


This option involves creating a "proxy" object of the "Bar" class that's non-static and only returns the result of the previous class' static method. You can then correctly mock that class and return the result in a more self-contained way. He lists a few caveats with this method including the fact that it could lead to a lot of proxy objects if there are a lot of static methods to replicate.


Link: http://tech.graze.com/2015/02/26/unit-testing-static-calls-without-refactoring-the-world-in-php/

Community News: Gophp7-ext Project


The GoPHP7 project has posted their initiative to try to improve the world of PHP for extensions and make them "first class citizens of the PHP community".



The goals of gophp7(ext) [are to]: get PHP extensions running "out of the box" when PHP7 is released (no lag time), make extensions in general easier to install and use (binaries, ppas), get more people involved in extension maintenance (and travis/appveyor running on them all, killing off bugs), get more documentation written for extension writing and codify some of the "best practices" of extension writing and design (a la PSR).


They're asking for help from anyone interested, even if you don't know C (what PHP extensions are written in). The project asks for just 30 minutes a day to help achieve their goals. The page also lists out the different ways you can help including cataloging the work that needs to be done on the catalog page and working on the development systems for PHP7 to make working with the extensions easier.


Link: http://gophp7.org/gophp7-ext/

2015年2月26日星期四

Site News: Blast from the Past - One Year Ago in PHP

Here's what was popular in the PHP community one year ago today:

Community News: Packagist Latest Releases for 02.26.2015

Recent releases from the Packagist: