Anna FilinaConFoo Vancouver & Montreal (28.10.2016, 20:58 UTC)

We recently released the presentations for ConFoo Montreal. This giant conference will be held on March 8-10, 2017.

It’s also the last chance to get tickets for ConFoo Vancouver, held on December 5-7, 2016.

ConFoo Vancouver 2016 & Montreal 2017ConFoo is a multi-technology conference aimed specifically at web developers. It has between 100 and more than 150 presentations by local and international speakers. This conference offers a great diversity in content to expand your knowledge and increase your productivity. It is the perfect place to sharpen those hard tech skills and discover the latest practices.

There is a great range of topics, including many programming languages, databases, security, performance, machine learning and project management.

SitePoint PHPHow’d They Do It? PHPSnake: Detecting Keypresses (28.10.2016, 16:00 UTC)

Vector image of an old school joystick

At a recent conference in Bulgaria, there was a hackathon for which Andrew Carter created a PHP console version of the popular "snake" game.

I thought it was a really interesting concept, and since Andrew has a history of using PHP for weird things, I figured I'd demystify and explain how it was done.

The original repository is here, but we'll build a version of it from scratch in this series so no need to clone it.

Screenshot of the game

Prerequisites and Rules

As usual, I'll be using my Homestead Improved box to get up and running instantly. You can use your own environment, just make sure it has a decent version of PHP runnable from the command line.

The snake game we're replicating has the following features:

  • a snake starts as a single on-screen character, and gets longer by one character every time it eats a piece of food.
  • food is spawned randomly anywhere on the map.
  • in single player mode, the snake is controlled by the arrow keys.
  • in two player mode, one snake is controlled with the WSAD keys, while the other is controlled with the arrow keys.
  • in single player mode, the walls are obstacles and cause a collision. Running into a wall or into yourself ends the game.
  • in multi player mode, only your own snake or the enemy's snake is an obstacle - the walls wrap around the world. Colliding will reset your snake's length to 0. The player with the longest snake after 100 seconds have elapsed is the winner.
  • it's CLI, so does not run in the browser - it runs in the terminal window

Note that the game doesn't work in native Windows - to run it on a Windows platform, use a good VM like Homestead Improved.


To launch a CLI (console) game, we need something similar to an index.php file in traditional websites - a "front controller" which reads our command line input, parses it, and then launches the required classes, just like in a traditional web app. We'll call this file play.php.

Continue reading %How’d They Do It? PHPSnake: Detecting Keypresses%

Stefan KoopmanschapThe Serendipity Machine (28.10.2016, 14:45 UTC)

I recently finished a book that has been in my possession for quite some time already, The Serendipity Machine by Sebastian Olma. Subtitled A Disruptive Business Model for Society 3.0 sounds very buzzword-y and startup-y, but despite the subtitle it was a very good book.

I've been a big fan of the Seats2Meet concept for quite a long time. The idea of getting a free working place including free lunch in exchange for sharing your knowledge and experience with others really appeals to me. I was first introduced to the concept quite a while ago by a colleague. Despite my business model causing me to work on-site with customers most of the time I've worked at Seats2Meet on several occassions, and with PHPAmersfoort we also organized meetups at one of their locations.

Some of the things discussed in the book really already describe what happens naturally in the PHP community. Especially things like sharing knowledge is happening a lot. One of the things where I think we can still improve though is the facilitating meetings. On the higher level, I mean to combat the isolation of the "islands" inside the greater PHP community, such as Drupal, Joomla! and all the different framework communities. But on a lower level, I also mean the people attending usergroup meetings and conferences. In a way, initiatives such as FIG provide a way of doing this, but on that smaller, lower level, we fail to do this, perhaps also because we fail to facilitate this. The fact that the majority of PHP developers is pretty introvert does not help, but all the more reason to facilitate these meetings.

So how do we facilitate this? you may ask. This is where we can have a look at how Seats2Meet does this. Their platform, where all visitors of the Seats2Meet locations sign in, allows people to "tag" themselves. In their profile, they list the topics they're expert in. For instance, my profile for Seats2Meet contains the following:

Tags in Seats2Meet profile

When you've book yourself a seat, you'll see the tags of other people that are there together with you, and you can look for the specific knowledge that you need. This is an active facilitation of meetings between people that have something in common. If at some point during the day while working at Seats2Meet you find yourself in need of some specific knowledge, all you have to do is check their system to see if someone with that knowledge is also at the location you are at.

The hallway track

This is where the hallway track at conferences becomes useful. While most people are in a session, staying in the hallway is a great way of meeting other people that made the same choice of a skipping a session. These kinds of random meetings are harder during breaks: There are so many people in the hallway at such a moment that it's hard to really decide who to talk to outside of the people you already know, also because everyone else is also talking to people they know. During a session though, there is little choice. So next time you skip a session, just talk to someone else that made the same choice. Even if you can't help eachother at that moment, you've expanded your network (or value network as Sebastian calls it in the book).

Conferences may facilitate these meetings by allowing "tagging" of people. Either through an online platform or by allowing people to add "tags" to their name badge. I can't tell you exactly how this should be done, but I do feel this is something that can be done in a better way, to facilitate these "random" meetings. To enhance the serendipity.

If all this sounds good, I would recommend you picking up a copy of The Serendipity Machine. It is an inspiring read, especially for those that are active in the PHP community. And if you're near a Seats2Meet location, book a seat for a day every once in a while. It's free and it's awesome.

The Serendipity Machine (ISBN 978-90-8169, November 2012, Creative Commons BY-NC-ND) is also available as free PDF download.

PHP ClassesPHP and JavaScript Innovation Award Report September 2016 Edition - July 2016 nominees (28.10.2016, 08:38 UTC)
By Manuel Lemos
This is the October edition of the Innovation Award podcast hangout recorded by Manuel Lemos and Johnny Mast to comment on the outstanding features of all the past month nominees and winners PHP and JavaScript packages, the prizes that the authors earned, starting with the nominees from the month of July 2016.

Listen to the podcast, or watch the hangout video to learn why the nominated packages were considered to be innovative, as well the current rankings of the Innovation Award Championship by author and by country.
Alan KnowlesPDO_DataObject Released (28.10.2016, 00:00 UTC)
Article originally from rooJSolutions blog
Coding was complete last month, and has a huge test suite to covering a large proportion of the features. This should mean that replacing DB_DataObjects will be pretty easy.
You can either just checkout the code from github  / PDO_DataObject , or use the pear channel 
#pear channel-discover
#pear install roojs/PDO_DataObject-0.0.1


Browse around here
I revived my old PHP_CodeDoc code  (That needs publishing). It seemed simpler than trying to use any of the other tools out there. It's a pretty simple tool to extract structure, and documentation comments from the PHP source code. I added a small amount of code to export to our 'Roo UI bjs toolkit format' 
The generated files are pure JSON, and mostly contain the contents from the comments un-formatted. I decided that doing the Markdown conversion in JavaScript was far simpler (I refactored slightly for use with our libraries)
There are a few other tweaks I made, using `@category` to group the documentation, and writing category pages (using roobuilder), then putting it all together the index.js file loads the parts, and renders the manual.
This week I finished tidying up the rendering on mobile, and making sure all the comments render nicely using markdown. The result should be a nice easy to read and use manual.

Simon HolywellFunctional Programming in PHP Second Edition Available Now (27.10.2016, 01:35 UTC)

It is with great pleasure that I announce the second edition of the Functional Programming in PHP book that I have been working on. There is twice the content of the first edition of the book as well as updates for PHP 7 and Facebook’s HHVM (HipHop Virtual Machine).

There are now more functional techniques and patterns included with pipelines, pattern matching and flat maps among them. I have added a section of the book dedicated to the handy syntax and functionality that HHVM can provide functional programmers with.

In addition I have, of course, listened to reader feedback and gone into a lot more detail about functions themselves, type signatures and their use, functional programming history and provided more examples of functional code in use. There is also a glossary of terms and appendices on libraries, REPLs and the frequently requested guide to using the UTF-8 ellipsis effectively in various editors.

On top of all that the book has been completely reorganised into a more logical structure with a better chapter breakdown.

So if you’re the kind of programmer who likes clean and easy to test code resulting in less bugs this is the PHP book for you. Even if functional programming isn’t really your thing all the techniques in the book will help you to become a better object oriented or procedural programmer.

To get your copy head on over to the books website for purchase links.

PHP: Hypertext PreprocessorPHP 7.1.0 Release Candidate 5 Released (27.10.2016, 00:00 UTC)
The PHP development team announces the immediate availability of PHP 7.1.0 Release Candidate 5. This release is the fifth release candidate for 7.1.0. All users of PHP are encouraged to test this version carefully, and report any bugs and incompatibilities in the bug tracking system. THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION! For more information on the new features and other changes, you can read the NEWS file, or the UPGRADING file for a complete list of upgrading notes. These files can also be found in the release archive. For source downloads of PHP 7.1.0 Release Candidate 5 please visit the download page, Windows sources and binaries can be found on The sixth and last release candidate will be released on the 10th of November. You can also read the full list of planned releases on our wiki. Thank you for helping us make PHP better.
SitePoint PHPShopify App Development Made Simple with HTTP APIs and Guzzle (26.10.2016, 19:01 UTC)

In this tutorial, you're going to get started with developing Shopify apps. You're going to create a simple app that lists out products from a Shopify store. The full source code of the app is available on Github.

Shopify logo

What are Shopify Apps?

Shopify apps are a way of extending the functionality of a Shopify store or to provide ecommerce capabilities to websites or mobile apps. Here's a list of approaches to do this:

  • HTTP API - gives web apps the ability to perform different operations in a Shopify store. Things like adding a customer, getting a list of products, or listening for different events. This is done by means of webhooks.
  • JavaScript Buy SDK - allows you to fetch product information, add items to a cart and checkout either from a website or hybrid mobile apps such as those built with Cordova.
  • Embedded App SDK - allows you to embed your web app directly into the Shopify admin interface. This is useful for apps that have an admin settings page. Instead of the user having to access it on a separate website, the web app will be loaded as an iframe.
  • iOS and Android Buy - used for integrating Shopify checkout into your iOS or Android app.
  • Shopify POS App SDK - allows you to embed your web apps directly inside the Shopify POS.

In this tutorial, you're going to learn about the HTTP API.

Sign up for a Shopify Partner Account

The first thing that you need to do is to sign up for a Shopify Partner Account. This allows you to create a development store for testing a Shopify app. You will be asked to fill out a form with things like your company name, business type, email address, website, password and other relevant information.

Shopify Partner Signup

If all the information you provided is valid, you should be greeted with the following page:

Shopify Partner Success Page

Create a Development Store

The next step is creating a development store which is like a Shopify store. You can add products, store HTML and CSS code for themes, and test purchases through a bogus payment gateway. The only limitation is that you can't add a custom domain or charge customers in a development store.

Click the Create a development store button and you will be redirected to the following page:

Create Development Store

Add the store name, the password for logging in to the store (your Shopify partner email address is the login email), and the kind of store to create. Stick with an Online store for now. This gives you the ability to build custom themes, develop an app, or set up your client's online store. Once you're done with filling the form, click the Create Store button to create the development store.

Continue reading %Shopify App Development Made Simple with HTTP APIs and Guzzle%

PHP ClassesHow to Validate Email Blacklisting Disposable Temporary Addresses (26.10.2016, 16:34 UTC)
By Suresh Kumar
Disposable email addresses are temporary addresses used by some people to access certain sites without using their real addresses.

Since these addresses prevent that the sites contact the users to send relevant information by email, it is useful for sites to prevent accepting this kind of addresses.

Read this article to learn how to validates temporary email addresses by blacklisting well known domains of disposable email address providers.
Nomad PHPWrite More Expressive Tests with Hamcrest PHP (26.10.2016, 15:05 UTC)

Speaker: Gareth Ellis @garethellis Have you ever struggled to write expressive, easy-to-read test assertions in PHP? If so, then Hamcrest PHP could be the answer. In this talk, I’ll show you how to use Hamcrest to make your test assertions a positively pleasant experience, and cover how you can create your own custom matchers for …

The post Write More Expressive Tests with Hamcrest PHP appeared first on Nomad PHP.

LinksRSS 0.92   RDF 1.
Atom Feed   100% Popoon
PHP5 powered   PEAR
ButtonsPlanet PHP   Planet PHP
Planet PHP