Younes Rafie, May 20

Localizing Dates, Currency, and Numbers with Php-Intl

Younes take a more detailed look at php-intl, this time focusing on localized dates, currencies, numbers, calendars, and more
Scott Molinari, May 18

Benchmarking: Can AppServer Beat Symfony's Performance?

Scott revisits Appserver and benchmarks it against Symfony to dispel the rumors of bas performance. Does he succeed? Tune in to find out!
Younes Rafie, May 16

Localization Demystified: Php-Intl for Everyone

Confused by php-intl and localization in general? Don't be! Younes explains what it's all about and guides us through some examples!
Wern Ancheta, May 13

We're Building a Marvel Catalog Reader! Avengers, Assemble!

In this tutorial, we're going to take a look at the Marvel API, a tool provided by Marvel for developers to get access to the 70-plus years of Marvel comics data.

Marvel logo

First, we'll walk through the steps in which one can acquire the keys needed to make requests to the API. Then, we'll look at the tools we can use to test out the API. Finally, we're going to build a website that uses the API.

Signing Up

The first thing we need to do is go to the Marvel Developer Website and click the Get a Key link. We'll then be provided with the public and private key which we can use to perform requests to the API. If you plan to use the project in production, you can also add your website's domain name to the list of authorized referrers. This provides a security layer in case you accidentally push your public and private keys to Github.

Important Notes Regarding the Use of the API

For limits and rules, please see the attribution, linking and rate limits page of their documentation. Also be sure to read the Marvel API Terms of Use if you're planning to use the API in production. I've summarized it below:

  • Beware of the API rate limit. At the time of writing of this tutorial the rate limit is 3000 calls per day. That's applicable to all the endpoints.
  • Always attribute Marvel as the source when displaying API data and images. Marvel recommends the use of this text: Data provided by Marvel. © 2016 Marvel.

Playing with the API

The API comes with an interactive documentation which allows you to easily test all the available API endpoints.

There's information on the data one can expect:

expected data

... text fields to specify the different parameters to be submitted for the request:


... error status codes:

error codes

... the request URL, response body, response code and the response headers:

request and response

Do note that the request URL won't actually return anything if you access it outside of the API testing tool. This is because it lacks the required parameters for the request. At the bare minimum, you'll have to supply the public key, the current unix timestamp, and an md5 hash of the timestamp, and private and public key combined.

$ts = time();
$public_key = 'your public key';
$private_key = 'your private key';
$hash = md5($ts . $private_key . $public_key);

Once you have those, only then can you perform a request to the API:

$query_params = [
    'apikey' => $public_key,
    'ts' => $ts,
    'hash' => $hash

//convert array into query parameters
$query = http_build_query($query_params);

//make the request
$response = file_get_contents('http://gateway.marvel.com/v1/public/comics?' . $query);

//convert the json string to an array
$response_data = json_decode($response, true);

We'll take a look at this in more detail when we get to the section where we start making requests for the app that we'll be building.

Daniel Berman, May 11

How Can the ELK Stack Be Used to Monitor PHP Apps?

Daniel Berman explains what the ELK stack is, how to install it, and how to make it analyze the logs of the typical LAMP stack
Reza Lavaryan, May 09

An Overview of PHPUnit 5 - What's New? What's Coming?

Did you miss the PHPUnit 5 train? Hop on board and find out what's new!
Bruno Skvorc, May 06

What Is Laravel Valet, and Why All the Fuss?

Laravel Valet is an OSX-only light-weight alternative to Vagrant for those quick, demo, throwaway projects.
Christopher Pitt, May 04

Building a SparkPost Client: TDD with PhpUnit and Mockery

Chris Pitt starts developing a new PHP package with TDD practices in mind - using PhpUnit and Mockery all the way. Check it out!
Christopher Pitt, Apr 29

Starting a Business with Laravel Spark

Chris Pitt goes from zero to hero in a post detailing the process of building an actual business app from scratch with Laravel Spark!
Bruno Skvorc, Apr 25

First Look at Pagekit CMS - Clean, Extensible, Fast, But...

Bruno looks at Pagekit, a CMS that recently reached V1 and offers what few others do out of the box, without being bloated. There is a caveat, though...
Christopher Pitt, Apr 22

What is SparkPost?

Chris Pitt looks at SparkPost, talks to their devangelist, and demonstrates a simple integration, building the foundation for more complex posts
Bruno Skvorc, Apr 20

Sourcehunt: Cron Management, Hackathon Starters, PHP-GUI...

In this edition of sourcehunt, we look at cron managers for PHP, a Laravel Hackathon starter kit, a PHP-GUI package that lets you do desktop-PHP, and more
Younes Rafie, Apr 18

Transducers in PHP Made Easy

Younes explains the concept of transducers and demonstrates their use in PHP with Michael Dowling's library
Jeroen Moons, Apr 13

Technical Debt: Rescuing Legacy Code through Refactoring

Jeroen Moons offers advice and lessons learned on how to get a legacy codebase under control and bring it to a new level of maturity.
Bruno Skvorc, Apr 13

Easy Multi-Language Twig Apps with Gettext

There are many approaches to internationalizing an app. Here's one using Gettext, Twig, and a solid application skeleton for a demo!
Thomas Punt, Apr 11

Contributing to PHP: How to Fix Bugs in the PHP Core

Thomas dives back into contributing to PHP's core - after covering documentation fixes last time, this time he fixes an actual bug in PHP. Learn how!
Thomas Punt, Apr 08

Contributing to PHP: How to Contribute to PHP's Manual

Contributing to PHP isn't nearly as difficult as it seems. In this post, Thomas shows you how to add patches to the online documentation for PHP!
Younes Rafie, Apr 07

Easy Deployment of PHP Applications with Deployer

Younes demonstrates Deployer, a tool for deploying PHP applications to live, development, or staging servers with just a few lines of PHP code.
Parham Doustdar, Apr 06

Containerized PHP Development Environments with Vagga

Parham dives into Vagga - a lightweight alternative to Docker useful for containerized development environments - and builds a PHP environment!
Wern Ancheta, Apr 05

PredictionIO and Lumen: Building a Movie Recommendation App

Wern continues the movie prediction app building process, this time nelisting the full power of Lumen, ElasticSearch, and PredictionIO
Wern Ancheta, Apr 04

PredictionIO: Bootstrapping a Movie Recommendation App

Wern creates a movie recommendation app with PredictionIO - a free machine learning engine
Christopher Pitt, Apr 01

Fun and Functional Programming in PHP with Macros

Christopher Pitt dives deeper into PHP macros, using them to add some functional programming to PHP!
Daniel Sipos, Mar 31

Drupal 8 Entity Validation and Typed Data Demonstration

Continuing the series on Drupal entity validation and typed data, Danny now teaches us how to extend this system with custom constraints and violations
Reza Lavaryan, Mar 30

A Comprehensive Guide to Using Cronjobs

A comprehensive introduction into cronjobs - how to use them, how to interpret the crontab format, and more