News Feed
Sections




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

Community News:
Packagist Latest Releases for 02.28.2015
February 28, 2015 @ 08:05:44

Recent releases from the Packagist:
0 comments voice your opinion now!



Community News:
Gophp7-ext Project
February 27, 2015 @ 12:39:00

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.

0 comments voice your opinion now!
gotphp7 extension project involvement community

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

Snack Overflow:
Unit testing static calls without refactoring the world in php
February 27, 2015 @ 11:55:06

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.

0 comments voice your opinion now!
unittest static method refactor proxy object mock tutorial

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

Laravel News:
Homestead Now With Blackfire Support
February 27, 2015 @ 10:05:47

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.

0 comments voice your opinion now!
blackfire support laravel homestead development environment performance

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

Derick Rethans:
Xdebug 2.3 Moar var_dump()
February 27, 2015 @ 09:58:40

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.

0 comments voice your opinion now!
xdebug vardump overload file path information output improvement release

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

Community News:
Packagist Latest Releases for 02.27.2015
February 27, 2015 @ 08:01:23

Recent releases from the Packagist:
0 comments voice your opinion now!




SitePoint PHP Blog:
Exploring the Cache API in Drupal 8
February 26, 2015 @ 11:41:45

On the SitePoint PHP blog today there's a new tutorial (by Daniel Sipos) talking about the Drupal 8 cache and showing how to use it in an example, caching the latest post data pulled from the Drupal content.

Drupal 8 comes with many improvements over its predecessor we have grown to both love and hate. Next to prominent systems such as Views in core, configuration management or a useful translation service, there are also less known changes but that are equally important to know and use. One such improvement has been the cache API that solves many performance problems we have in Drupal 7.

They start with a basic introduction to the new cache handing and how the caches are separated out into different "bins" rather than all stored in one place. He includes sample code showing how to: save data to the cache, getting information back out and invalidating the cache to be handled by garbage collection. He also covers the cache tags, a feature that allows you to "tag" items across multiple caches and remove/invalidate them all at the same time. He wraps up the post getting into the more practical example showing the caching at work in a controller caching the contents of the posts to the Drupal site.

0 comments voice your opinion now!
drupal cache drupal8 tutorial introduction improvement

Link: http://www.sitepoint.com/exploring-cache-api-drupal-8/

Benjamin Eberlei:
Integrate Symfony and Webpack
February 26, 2015 @ 10:21:40

In his latest entry Benjamin Eberlei shows how he integrated Symfony and Webpack, a tool that makes it simpler to package up multiple assets (like Javascript or CSS files) and reduce them down to combined files, reducing the overhead on page loads.

Asset Management in Symfony2 is handled with the PHP based library Assetic by default, however I have never really connected to this library and at least for me it usually wastes more time than it saves. [...] While researching about React.JS I came across a tool called Webpack which you could compare to Symfony's Assetic. It is primarily focussing on bundling Javascript modules, but you can also ship CSS assets with it.

He talks about some of the main benefits to using the Webpack tool including a built-in web server to serve up the assets and a "hot reload" plugin that refreshes when assets change. He then gets into a more practical example, showing how the tool works with a typical asset structure in a Symfony application. He shows how it uses the internal server to prevent the need for a complete rebuild each time. He also shows how to install and configure it through Symfony and loading the Javascript file in your Twig template. Finally he shows how to run a build, the resulting output and the integration he mentioned with React.js.

0 comments voice your opinion now!
symfony asset webpack tool tutorial introduction configuration install

Link: http://www.whitewashing.de/2015/02/26/integrate_symfony_and_webpack.html

Stephan Hochdörfer:
Running PHPUnit via Phing on HHVM
February 26, 2015 @ 09:16:58

Stephan Hochdörfer has a quick post showing how he has PHPunit up and working on an HHVM instance. His problem was that the tests were actually executing using the "php" binary, not the HHVM one.

For quite some time we run the unit tests for our libs and tools against PHP and HHVM, at least that is what I thought up to now. As it turns out I missed a minor detail. [...] What happens now is that Phing is executed via HHVM but PHPUnit will still be executed via the PHP binary because the PHPUnit shell script will look for the php binary in the PATH configuration. Since we run HHVM side-by-side with PHP on our Jenkins build nodes I was not able to point /usr/bin/php to /usr/bin/hhvm - which would be the easiest and cleanest solution. I

He shares the workaround he created, creating a symbolic link between the hhvm and php binaries and then executing the Phing task to run the tests. This is being run via Jenkins and uses it's "WORKSPACE" as a container so the main "php" binary isn't overwritten.

0 comments voice your opinion now!
hhvm phpunit test unittest execute binary path jenkins phing task

Link: https://blog.bitexpert.de/blog/running-phpunit-via-phing-on-hhvm/


Community Events

Don't see your event here?
Let us know!


podcast framework version library extension security laravel5 opinion language release series unittest interview threedevsandamaybe api symfony introduction laravel voicesoftheelephpant community

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework