News Feed
Jobs Feed
Sections




News Archive
feed this:

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

SitePoint PHP Blog:
How to Speed Up Your App's API Consumption
April 11, 2014 @ 10:51:23

The SitePoint PHP blog has some advice posted today from Jacek Barecki about how you can speed up your use of other APIs with a few performance increasing tips.

In the process of creating a PHP application you may come to a point when keeping it isolated from remote resources or services may become a barrier in its development. To move along with the project you may employ different API services to fetch remote data, connect with user accounts on other websites or transform resources shared by your application. [...] But using APIs in an incorrect way can quickly lead to performance issues and lengthen the execution time of your script. If you're looking for a way to avoid it, consider implementing some of the solutions described in the article.

He recommends four things you can think about doing to help make the most effective use of these services:

  • Make multiple requests at a time
  • Separate API calls from the app main flow
  • Build a smart cache engine
  • Master the API documentation
0 comments voice your opinion now!
api performance recommendation tips usage

Link: http://www.sitepoint.com/speed-apps-api-consumption/

Community News:
Apigility 1.0.0beta1 Released!
March 25, 2014 @ 10:41:03

Zend has officially announced the release of the 1.0.0beta1 of Apigility, their API creation platform making it simpler for developers to get started making APIs, even around existing code.

We are pleased to announce the immediate availability of Apigility 1.0.0beta1! [...] This is our first beta release of Apigility, marking its initial API stability, and providing a solid preview of what to expect for the first stable release. [...] Apigility provides tools for describing and documenting your APIs, both RESTful and RPC. You can indicate the URL that provides a service, what HTTP methods are allowed, what representations (e.g., JSON, HTML, XML) can be provided, how many items to present per page of a collection, and more.

The release goes on to talk about some of the other features of Apigility including the standard of JSON responses, custom validation for incoming data and an implementation of the Swagger UI bundled for documentation of your service. There's also a list of things (with code examples on some) about what's changed in this beta release since 0.9.1. There's also a brief look at the end of the roadmap ahead, with an emphasis on a full, stable release soon.

0 comments voice your opinion now!
apigility api zendframework beta release

Link: http://framework.zend.com/blog/apigility-1-0-0beta1-released.html

HHVM Blog:
Tracking Parity
March 04, 2014 @ 10:43:13

On the HHVM blog today there's a new post shows how far along they are with parity with the PHP language based on the tests from a sampling of several large PHP-based projects.

HHVM has a large suite of unit tests that must pass in several build configurations before a commit reaches master. Unfortunately, this test suite passing doesn't tell you if HHVM can be used for anything useful - so we periodically run the test suites for popular, open source frameworks. [...] The frameworks test page is now public, as is the JSON data backing it (which you're welcome to use).

They look briefly at what exactly is tested (latest stable version, with exceptions) and how it all works. The tests are run once an hour and are based on a completely clean build of HHVM in "csv" mode. The results of the tests are automatically pushed into the MySQL+Memcached system reporting system, accessible via the JSON API.

0 comments voice your opinion now!
parity tracking unittest framework hhvm project json api

Link: http://www.hhvm.com/blog/3611/tracking-parity

VG Tech:
Swagger Docs in ZF2 with Examples - Part 1 Setup and Annotations
February 25, 2014 @ 10:33:48

The VG Tech blog has posted the first part of a series they're doing about Zend Framework 2 and Swagger, the auto-generating documentation project for APIs. In this first part of the series, they go through some setup and show the use of annotations to define the Swagger output.

So everyone is building APIs now - parsing and outputting JSON is not that hard. Some people even build truly RESTful APIs, or something not to far from that. Before, when building APIs was about SOAP with XML schemas and WSDL specifications, people spent so much time building their APIs that they had the time to think. Now, building an API is so easy and fast that the documentation is often suffering. [...] Swagger is a popular project providing auto generated API docs based on a service specification. This spec is based on annotation comments in the controllers and models, giving the developer a fairly easy, and close to the code way of keeping the API docs up to date.

He walks you through the process to clone and setup the Zend Framework 2 project first, then pull in the "outeredge/swagger-module" with Composer. This package provides the tools to generate Swagger output from annotations in the PHP code. He also shows you how to set up the Swagger UI project (wordnik/swagger-ui). Finally, he gets into the code examples, showing how to annotate models and use partials.

0 comments voice your opinion now!
swagger api zendframework setup annotation tutorial series part1

Link: http://tech.vg.no/2014/02/24/swagger-docs-in-zf2-with-examples-part-1-setup-and-annotations/

Voices of the ElePHPant:
It's the Booze Talking #6 - APIs Part 2
February 18, 2014 @ 12:09:13

The Voices of the ElePHPant podcast has posted the second part of their latest "It's the Booze Talking" series. This episode is part two of the APIs session recorded at this year's Sunshine PHP Conference.

Guests for this episode were Keith Casey, Paul Jones, Larry Garfield, Matthew Weier O'Phinney, Phil Sturgeon, Zack Kitzmiller, Luke Stokes and, of course, host Cal Evans. Topics mentioned include books by some of the guests about APIs and legacy applications, PHP The Right Way and many others.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. If you'd like to check out the first part of the series, head over to this post.

0 comments voice your opinion now!
voicesoftheelephpant boozetalking api part2 series sunshinephp14

Link: http://voicesoftheelephpant.com/2014/02/11/its-the-booze-talking-6-apis-part-2

Voices of the ElePHPant:
It's the Booze Talking #6 - APIs Part 1
February 11, 2014 @ 09:18:50

The Voices of the ElePHPant podcast has release their latest episode today in their "It's the Booze Talking" series. This latest episode, "APIs Part 1" (epside 6) includes a panel of guests including Keith Casey, Larry Garfield, Matthew Weier O'Phinney and Luke Stokes.

This episode was recorded live at this year's Sunshine PHP conference that just wrapped up in Miami, Florida. Note: this episode does have an "explicit" tag attached for some of the language during the conversation, so be warned.

You can listen to this latest episode either through the in-page player or by downloading the mp3 directly. To get more great community interviews and panels, be sure you subscribe to their feed to get the latest.

0 comments voice your opinion now!
booze talking voicesoftheelephpant podcast api panel discussion

Link: http://voicesoftheelephpant.com/2014/02/11/its-the-booze-talking-6-apis-part-1/

Codeception.com:
Testing Emails in PHP. Part 1 PHPUnit
December 18, 2013 @ 13:04:05

On Codeception.com an tutorial has been posted showing you how to use PHPUnit to test emails - verifying that your application emails are being sent with the help of a third-party service.

So how do you check that your applications sends email correctly? It looks like dealing with emails is always a challenge. How would you verify that email message is formatted and delivered correctly, without actually sending them to your clients? That's the first question. And the second question is: how can we automate testing of emails? For both questions we have an answer.

To answer the first, they recommend using a service like Mailtrap or Mailcatcher (the one they use for the post) to receive the emails for evaluation. They help you get both PHPUnit and the popular Guzzle HTTP library installed to help with resting against Mailcatcher's REST API. The example test is also included, showing a few methods that connect to the API, get the most recent messages and clear the list when it's complete. Assertions like assertEmailIsSent, assertEmailHtmlContains and assertEmailSenderEquals show how to test the message results that come back for validity.

0 comments voice your opinion now!
test unittest phpunit email send mailcatcher rest api

Link: http://codeception.com/12-15-2013/testing-emails-in-php.html

SitePoint PHP Blog:
Translation and Text-to-Speech with Microsoft Translator
December 05, 2013 @ 09:19:29

On the SitePoint PHP blog today there's a new tutorial showing you how to combine the Microsoft Azure platform services with their Translator API to create a text-to-speech translation service with some simple curl calls.

Text to speech is a popular technique used by many websites to provide their content in an interactive way. The generation of artificial human voice is known as Speech Synthesis. Even though it's highly popular, there are very few speech synthesis services, especially when looking for those free of charge. Microsoft Translator is one of the services we can use to get a speech service with limited features. In this tutorial, we are going to look at how we can use Microsoft Translator API to translate content and then make audio files using said content.

He walks you through setting up an Azure application (you'll need an account for the marketplace already) and how to subscribe to the translation service. It's a paid service but there's a "try before you buy" level that allows 2,000,000 characters of translation before it's cut off - perfect for testing. He includes the PHP to make the requests to the Translation API via curl. Included is code to initialize the configuration for the request, get the correct tokens and a reusable method for making the actual translation request. Finally, an example of doing the actual text-to-speech conversion is shown, resulting in an mp3 file.

He also includes an example of a simple frontend UI. You can see a working demo of the script here.

0 comments voice your opinion now!
microsoft translator api texttospeech text speech tutorial azure service

Link: http://www.sitepoint.com/translation-text-speech-microsoft-translator/

Inviqa techPortal:
Create a RESTful API with Apigility
December 04, 2013 @ 09:29:15

On the Inviqa techPortal they've posted a new tutorial from Rob Allen introducing Apigility, the recently announced API management and creation tool from Zend. He uses his usual album/music illustration to show how to create a simple API inside the tool.

On the 7th October 2013, Zend introduced Apigility to the world. Once you get beyond the name, you see a very interesting project that allows you to easily create a web service without having to worry about the nitty-gritty details. Which details? Well, Apigility will handle content negotiation, error handling and versioning for you, allowing you to concentrate on your application. In the recently tagged 0.7 release, Apigility also supports both HTTP and OAuth2 authentication. In this tutorial we will create a simple REST API that allows us to view a list of music albums, showing how to start using Apigility and how to publish an API using this tool.

He walks you through all the steps you'll need to create the basic API, more specifically around the "Albums" data and functionality:

  • Creating a new project with Composer
  • Using the Admin dashboard to create a new API
  • Making a new REST endpoint (albums)
  • Building an Album collection endpoint (with Collection, Entity and Resource)
  • Making the data model, including the table SQL

He includes all the code you'll need for these last few items and shows the curl calls to make for grabbing a single and multiple album listings. There's also a brief discussion in there about how Apigility handles API versioning with some internal handling.

0 comments voice your opinion now!
apigility zend rest api tutorial introduction

Link: http://techportal.inviqa.com/2013/12/03/create-a-restful-api-with-apigility/

Phil Sturgeon:
Build API's That You Wont Hate Part 1 - Useful Database Seeding
November 11, 2013 @ 09:19:33

Phil Sturgeon has posted the first part of a series he calls "Build API's That You Won't Hate", a follow up to one of his previous posts about building good APIs in your application.

A little while back I produced an article called Building a Decent API which was mostly a tongue-in-cheek list of things that I'd come across in other APIs that pissed me off, or that I had done myself and used my super-power of hindsight combined with sarcasm to make a set of rules for you to live by when building APIs. The combination of cheek and naughty words made that "eat your greens" article go down a lot more smoothly, but it certainly lacked a little substance but I always wanted to turn that into a much more in depth of blog posts.

In this first part of the series he covers one main topic - generating "good" data for you to use in your development environment. As he points out, using production data in development databases dangerous for several reasons. He suggests the Faker library to do what's called "database seeding" and generating fake, but accurately formatted, data to use for testing. He includes some sample code showing how to use the PHP tool to generate as set of seed user data. He also shows how to create a DatabaseSeeder class for Laravel and integrate it with the tool.

0 comments voice your opinion now!
api development database seeding faker laravel

Link: http://philsturgeon.co.uk/blog/2013/11/build-apis-part-1-useful-database-seeding


Community Events











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


opinion code framework hhvm symfony2 composer overview application introduction example release component package unittest install podcast language hack facebook security

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