As 2013 finishes, I continue my tradition of showing off some photos that recap my year. Last year I discovered that I didn't take many photos at all, so this year I've published at least one photo every day! A lot of them were rubbish, but a good number are shots that I'm very pleased with. I've done this recap in 2008, 2009, 2010, 2011 and 2012. January It rained in January. I liked this… continue reading.
The Composer package manager along with the Packagist repository site is quickly becoming the defacto PHP package management system. One feature I found out about recently is that you can install packages globally rather than locally into your project. I think that this is most useful for development tools, such as PHPUnit which are then available everywhere.
A few days ago, techPortal published my tutorial Create a RESTful API with Apigility. Apigility was announced at ZendCon US in October 2013 and I think that it looks like a useful tool for creating APIs. I particularly like that versioning is built in from the start and that it handles content negotiation. If you want to learn about Apigility, then have a read. The source code is available on GitHub.
With OS X 10.9 Mavericks, Apple chose to ship PHP 5.4.17. This is how to set it up from a clean install of Mavericks. Note: If you don't want to use the built-in PHP or want to use version 5.5, then these are some alternatives: PHP 5.3/5.4/5.5 for OS X 10.6/10.7/10.8/10.9 as binary package by Liip Zend Server (Free Edition) Homebrew has PHP. Let's go!
Manuel Stosic has posted Understanding Zend Framework 3 before it's out ZF3 is not close around the corner. It's still many, many months ahead. But there are reasons why you should bother and get information about ZF3 as soon as possible. Manuel goes on to explain that you can find out information about ZF3's development on Google Moderator, PRs on GitHub, the wiki and an upcoming Hangout next week.
Lorenzo Ferrara has posted Testing Apigility Code-Connected REST API First thing, I've installed Apigility following the readme on GitHub, opened the admin interface and clicked on the "Get Started!" button. Things are pretty straightforward: added the new API clicking on the "Create New API" button located in the top-right corner, typed in FortuneCookie and pressed the "Create API". Next thing, I've added the new Code-Connected REST service called OpenCookie. So far so good. He goes… continue reading.
At ZendCon 2013, Zend announced Apigility which is intended to ease the creation of APIs. It consists of these things: A set of ZF2 modules that do the heavy lifting of creating an API A application wrapper for creating standalone web API applications A built-in administration website for use in development to define the API Rather nicely, it supports REST and RPC and deal with error handling, versioning & content negotiation for you. Getting started… continue reading.
As joind.in uses GitHub to host its source code, we use the IRC hook to receive notifications to the IRC channel (#joind.in on freenode) when interesting things happen on the GitHub repositories. We noticed recently that we were being notified about more types of things happening on some repositories compared to others, so I decided to investigate. The code for this is here and a quick perusal of it shows that it will do something… continue reading.
If you have a standard ZF2 application and accept application/json requests in addition to application/html, then you have probably noticed that when an error happens, HTML is created, even though the client has requested JSON. One way to fix this is to create a listener on MVC's render event to detect that an error has occurred and substitute a JsonModel in place of the ViewModel. The easiest way to do this in your ApplicationModule. Firstly,… continue reading.
I'm currently writing some documentation in Restructured Text that I'm targeting at HTML and PDF using rst2html and rst2pdf. For syntax highlighting, both rst2html and rst2pdf use Pygments, however rst2html doesn't support any Pygments options. So a typical PHP snippet in rst targeting rst2pdf, would be written as:
.. code-block: php
$this = str_replace('foo', 'bar', $that);
The startinline Pygments option is to allow it to highlight the snippet, even though the opening <?php is missing. If you run rst2html, you get this… continue reading.