2013年12月31日星期二

Community News: Latest PECL Releases for 12.31.2013

Latest PECL Releases:
  • pdflib 3.0.3
    - fixed bug #66346 (undefined reference to `pdf_begin_pattern_ext')


  • swoole 1.6.8
    - Fix all gcc wanning
    - support pecl install
    - new function swoole_server_taskwait
    - remove *.lo files


Community News: Packagist Latest Releases for 12.31.2013

Recent releases from the Packagist:

Chris Hartjes: Test Spies and Mockery


Chris Hartjes has a new post today looking at using test spies with Mockery, the alternative mocking framework to PHPUnit's own built-in functionality. Test spies are a feature that allows you to replace certain functions and methods of already created objects to help make mocking functionality easier.



While recording some screencasts I was struggling to figure out how to get PHPUnit's built-in object mocking tools to allow me to create what is known as a "test spy". I talk about them briefly in my PHPUnit Cookbook but I think that what I wanted to do in this instance was beyond what PHPUnit could give me.


He works through what he tried with the built-in PHPUnit mocking and found that it wasn't using the objects he provided as expected. He shifted over to Mockery and created a working version using the "shouldReceive" and "with" methods to handle the checks (spies) on the objects correctly.


Link: http://www.littlehart.net/atthekeyboard/2013/12/27/test-spies-and-mockery

Joshua Thijssen: Decoding TLS with PHP


Joshua Thijssen has posted a walk-through of some work he's done to create a TLS decoder in PHP. TLS (Transport Layer Security) is a method for encrypting data being sent back and forth between the client and server, similar to how SSL is used.



As a proof of concept I wanted to see in how far I could decode some TLS data on the client side. Obviously, this is very complex matter, and even though TLS looks deceptively simple, it isn't. To make matters worse, PHP isn't quite helping us making things easy neither.


His solution (code posted here) goes through a few steps to finally get to the actual data:



  • Capturing TLS data
  • Gathering all the necessary fields
  • From pre-master-secret to master-secret (decoding TLS_RSA_WITH_RC4_128_SHA)
  • Partitioning our master-secret
  • Decoding our data
  • Verifying message integrity


For each step along the way he shares the relevant code and a brief description of what's happening. If you want to see the end result and try it out for yourself, check out his repository.


Link: http://www.adayinthelifeof.nl/2013/12/30/decoding-tls-with-php

Voices of the ElePHPant: Interview with Shawn Stratton


The Voices of the ElePHPant podcast has published their latest episode, another in their series of interviews with PHP community members. This episode features Shawn Stratton.



They talk some about Shawn's current work, a migration from pure PHP development to a more operations kind of role and some of the considerations he's had to make. He also talks about the one lesson he recommends to both ops and dev to help them work together more effectively. They also discuss some of the tools he uses to help make the development environment easier and more useful for developers.



You can listen to this latest episode either through the in-page player, by downloading the mp3 or by subscribing to their feed.


Link: http://voicesoftheelephpant.com/2013/12/31/interview-with-shawn-stratton

2013年12月30日星期一

Community News: Latest PEAR Releases for 12.30.2013

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.30.2013

Recent releases from the Packagist:

Kevin van Zonneveld: It's Almost 2014 and We Are Still Committing Broken Code


Kevin van Zonneveld has a new post that, while not PHP specific, does have a handy script that will help you stop committing broken code.



Whatever the reason, it's almost 2014 and we are still committing broken code. This needs to stop because best case: Travis or Jenkins prevent those errors from hitting production and it's frustrating to go back and revert/redo that stuff. A waste of your time and state of mind, you were already working on other things. Worst case: your error goes unnoticed and hits production.


To help resolve the problem, he suggests using the "hook" system common to most version control software. In his specific example, he shows the use of a pre-commit hook that fires off a bash script on the files being committed. He includes the full code for this bash script that includes a check for PHP scripts using the built in PHP linter (the "-l" option on the command line). He also includes the commands and updates you'll need to make to get it installed on git.


Link: http://kvz.io/blog/2013/12/29/one-git-commit-hook-to-rule-them-all/

SitePoint PHP Blog: Best PHP Frameworks for 2014


On the SitePoint PHP blog Bruno Skvorc has posted what could be "best PHP frameworks for 2014". The results were compiled from the feedback of a survey they recently took during the past week.



We asked these questions to decide which frameworks deserve our attention in 2014 the most. The prerequisite for participation was merely having experience in more than one framework, seeing as it's pointless to ask someone what their favorite bar was if they've only drunk in one place.


In the end, the results showed some interesting trends in the choice of PHP framework and their overall popularity. The three topping the popularity charts were (in this order) Laravel, Phalcon then Symfony2. Other mainstay frameworks like Zend Framework, Yii and CodeIgniter were ranked lower in the list. He goes through the results and provides a bit of background on the feedback, including how much of the original data had to be filtered out for one reason or another. He also includes a list of "noteworthy answers" from various folks responding to the survey. His personal choice? Phalcon because of it's overall performance and the community around it.



So which framework seems most promising for 2014? Which should you switch to in the new year? Is it worth it? That's entirely up to you - as always, it depends on your comfort level, the project requirements, and time you have to study new things.

Link: http://www.sitepoint.com/best-php-frameworks-2014/

2013年12月29日星期日

Community News: Packagist Latest Releases for 12.29.2013

Recent releases from the Packagist:

2013年12月28日星期六

Community News: Packagist Latest Releases for 12.28.2013

Recent releases from the Packagist:

2013年12月27日星期五

Site News: Popular Posts for the Week of 12.27.2013

Popular posts from PHPDeveloper.org for the past week:

Community News: Packagist Latest Releases for 12.27.2013

Recent releases from the Packagist:

Voices of the ElePHPant: Interview with Matthew Weier O'Phinney


The Voices of the ElePHPant podcast has posted it's latest episode - another interview with a member of the PHP community. In this latest interview Cal talks with Matthew Weier O'Phinney of Zend.



Matthew and Cal talk about Zend's latest offering to the PHP ecosystem - Apigility, an API generation and management system that take some of the "boring" work out of making APIs (based on Zend Framework). Matthew talks about all of the features and benefits that Apigility provides and answers some of the questions Cal has about the project.



You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. You can also catch up with their past episodes (and keep up with new ones) by following their feed.


Link: http://voicesoftheelephpant.com/2013/12/24/interview-with-matthew-weier-ophinney-2/

David Makin: Creating a simple REST application with Silex


David Makin has put together a new post to his site showing you how to make a simple REST web service with Silex, the PHP microframework from the Symfony project.



So you have come to the conclusion that, rather than having the code to update customer details and that little fix to convert the date from GMT to UTC should happen in once place rather than being copied into several pieces of code, a REST service is the answer. Perhaps you just think you should know how to create a REST service. Either way this post is for you. In this post we will start off with a blank directory and go through installing Silex and getting it to serve a couple of simple routes.


He helps you get Silex installed via Composer and gets you started with a simple root and "stock code" route. He uses these to explain a bit about the framework's route handling and includes URLs to call that will execute them.


Link: http://sleep-er.co.uk/blog/2013/Creating-a-simple-REST-application-with-Silex/

BitExpert.de Blog: Composer, Bower and HTTP Basic Auth


Stephan Hochdörfer has shared a handy tip for the Composers users out there that may have to deal with username/password protected repositories as a part of your package install process. In his post he shows how to use a simple "expect" script to automatic the HTTP Basic Auth login.



A couple of months ago when we set-up our own internal Satis repository to host our custom Composer packages. We ran into an "unpleasant" issue with Composer that had this PR as an result. To sum things up: We are using HTTP Basic Auth to password-project our Satis repository. There was no way we could switch to an SSL client certificate to allow Composer to authenticate itself automatically without asking for a password. Asking for the password on a developer`s machine is no big thing, but it since we need an automated Composer run in our Jenkins environment, there was no way to set things up.


As Composer doesn't currently support this functionality, they had to find a way around it. They went with an expect script that is used to work with the prompts and send the username/password information when expected. He also points out that this could be useful for other situations and tools - like a Bower build.


Link: http://blog.bitexpert.de/blog/composer-bower-and-http-basic-auth/

2013年12月26日星期四

SitePoint PHP Blog: Build Virtual Machines Easily with PuPHPet - Part 2


On the SitePoint PHP blog Matthew Setter is back with the second part of his series looking at using PuPHPet to make VMs easily. In this second part, he continues on and looks more at the configuration files generated and tweaking them a bit.



We looked at how to configure most of the options and how to use the generated configuration, with some basic vagrant commands. But that's as far as we went. So in this second part of the series, we're going further. Specifically, we're going to be looking at the two core files used: common.yaml, and Vagrantfile. We'll be making some changes to them, then provisioning the virtual machines to reflect the configuration changes.


He talks about some of the changes he'll be making including the location of the shared folder and some of the setup of the PHP installation. He also updates the XDebug and MySQL configurations to change a few other options for more control over the resulting instance.


Link: http://www.sitepoint.com/build-virtual-machines-easily-puphpet-part-2/

2013年12月25日星期三

Community News: Latest Releases from PHPClasses.org

Community News: Packagist Latest Releases for 12.25.2013

Recent releases from the Packagist:

2013年12月24日星期二

Community News: Latest PECL Releases for 12.24.2013

Latest PECL Releases:
  • swoole 1.6.7
    - First version for pecl.net


  • pdflib 3.0.2
    - support PDFlib 9.0.2


  • timezonedb 2013.9
    Updated to version 2013.9 (2013i)


  • riak 1.1.3
    Since 1.0 stable
    Features:
    Issue 10: Automatic retry implemented and set to 1 retry by default
    Issue 50: vClock now gets read from object if not present in input, making vclock easier to work with.
    Issue 54: Conflict resolver can now be set on a bucket or passed along to the get function, which can make conflict resolving a lot easier.
    Fixes:
    Issue 55: Implemented missing getter for last modified on object.


  • riak 1.1.2
    Fixed issue 65: Conflict resolvers no longer do an automatic put when conflicts are resolved.


Community News: Packagist Latest Releases for 12.24.2013

Recent releases from the Packagist:

NetTuts.com: BDD With Behat


On NetTuts.com they've posted an introductory level tutorial for those that are exploring the world of testing and want to get their feet wet using some other tools. In this new post they introduce Behat, a human-readable functional testing tool written in PHP (but not just for PHP applications).



The BDD PHP framework Behat, allows you to test your PHP applications using human-readable sentences to write features and scenarios about how your applications should behave in order to test out its functionality. We can then run these tests to see if our application is behaving as expected. Let's spend about 15 minutes quickly going over Behat's installation process and learn how we can test our PHP applications behavior using the basics.


They help you get the tool installed (via Composer) and show you how to create your first feature file. They use a simple "adder" class for their examples that has two methods - add and display. The article covers features, scenarios and steps - including the code you'll need to add to the context file for any custom steps. Finally, they show how to run the tests and a sample of what the output looks like when everything's successful.


Link: http://net.tutsplus.com/tutorials/php/bdd-with-behat

HHVM Blog: We are the 98.5% (and the 16%)


On the Facebook HHVM (HipHop VM) blog there's a recent post sharing some of their progress towards parity with the PHP language inside the tool (and the results of their "three week lockdown").



On November 4th, the HHVM team went on a 3-week performance and parity lockdown. The lockdown officially ended on November 22th. Overall, this lockdown was a qualified success. [...] Going into lockdown, the team knew that awesome performance alone would not suffice in making HHVM a viable PHP runtime to be used out in the wild. It actually had to run real, existing PHP code reliably.


In the post they include some numbers from their testing, the pass/fail status of the unit test suites for several major PHP projects including Composer, Joomla, Laravel, Slim and phpMyAdmin (with an overall parity of 98.58%). They share the raw numbers of the results and describe some of the testing environment, including some "assumptions and caveats" about the process. They also contributed back fixes as a part of the work, putting pull requests out there for several projects. They finish the post with some of the performance numbers, noting that they passed their goal and made it to 16% for an instance of facebook.com.


Link: http://www.hhvm.com/blog/2813/we-are-the-98-5-and-the-16

Doctrine Project: Our HHVM Roadmap


The Doctrine project has posted an update about the work being done in collaboration with and to help its performance with HHVM (the HipHop VM from Facebook) and talking about their future plans.



Facebook has been pushing HHVM alot lately, helping open source projects to get their test-suite running 100%. For Doctrine HHVM is particularly interesting, because of the performance gains that the complex PHP algorithms inside ORM would probably get. From my current feeling Doctrine will be the PHP open-source project getting the most gain from running on HHVM. However with the tests not yet passing on the ORM, we can only imagine how big that performance improvement will be.


One of their goals is to be able to run DBAL/ORM on HHVM with 100% passing tests. So far they've been working on Common project functionality and have three as fully supported under HHVM - Collections, Inflector and Lexer. Work is still being done on other parts of the codebase, with the ORM and DBAL being the lion's share of the job.


Link: http://www.doctrine-project.org/blog/our-hhvm-roadmap.html

2013年12月23日星期一

Community News: Latest PEAR Releases for 12.23.2013

Latest PEAR Releases:

Community News: Packagist Latest Releases for 12.23.2013

Recent releases from the Packagist: