News Feed
Sections




News Archive
feed this:

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

NetTuts.com:
Create a Custom API in Magento Part Two
July 03, 2015 @ 10:54:02

NetTuts.com has posted the second part of their series showing how to create a custom API in Magento. In part one of the series they focused on creating a custom module that worked with the core APIs and system. In this new post they approach it from the other side and show how to use those APIs created in part one.

In this series, we're discussing custom APIs in Magento. In the first part, we created a full-fledged custom module to implement the custom API, in which we created the required files to plug in the custom APIs provided by our module. In this second and last part, we'll go through the back-­end section to demonstrate how to consume the APIs.

They start with a quick recap of the things created in the first part of the series and how to ensure it's set up correctly to be accessed as an API endpoint. Next they set up the user and role configurations that you'll need to access the new API through the administration panel. Finally, they show you how to use the API through a simple SoapClient request.

0 comments voice your opinion now!
magento custom api series tutorial part2 usage

Link: http://code.tutsplus.com/tutorials/create-a-custom-api-in-magento-part-two--cms-23821

SitePoint PHP Blog:
Mobile App Development with Zend Studio
June 29, 2015 @ 10:14:41

On the SitePoint PHP blog they've posted a new tutorial from Daniel Berman about using Zend Studio to create mobile applications in the same interface you're using (if you're a Zend Studio user) to create your PHP applications.

The world has turned mobile. This is not new, and it should therefore be no surprise to anyone that the results of the 2015 DevPulse survey by Zend show that a vast majority of PHP developers are working on, or intend to work on, mobile apps.

Mobile app development poses many challenges for developers, one of which is tying in the front end of the mobile application with the back-end web service APIs. This tutorial describes how to simultaneously create, test and modify both the front and back end of a modern mobile app using Zend Studio's mobile development features.

He breaks the rest of the post up into several steps to help you get a simple mobile project up and running, complete with a basic Apigility API backend:

  • Creating a Cloud Connected Mobile Project
  • Previewing your App
  • Developing the Back-End APIs
  • Developing the Front-End
  • Testing as an Android Native App
  • Exporting a Native Application Package

The end result is a simple "cloud connected" application that can be installed directly on an Android device as a ".apk" package.

0 comments voice your opinion now!
tutorial mobile application zendstudio android api apigility

Link: http://www.sitepoint.com/mobile-app-development-zend-studio/

SitePoint PHP Blog:
Popular Users per Language and Region with Silex and Github
June 18, 2015 @ 11:53:49

The SitePoint PHP blog has a new tutorial posted showing you how to use the data the GitHub API provides to find popular users, per language, in an area. His sample example is a simple Silex framework based application and uses the KNPLabs GitHub library to interface with the API.

The data you can get through the GitHub API V3 is mostly what you can see on the GitHub web interface, except you can use the data in your application to come to interesting conclusions. That is what we are going to do in this article. [...] Now, what if there was a web service in which we could specify a location and a language (e.g. PHP) and get a sorted list of contributors to open-source? [...] In our web service, we will have one endpoint (i.e. action, URL) that shows the most popular ten creators. The most popular creators are the people in a location who have the largest number of stargazers. For this, we will retrieve each person's repositories and add up the number of times each one has been starred.

He steps you through getting a Homestead Improved VM up and running (via Vagrant) and a basic Silex application up and running inside. He then pulls in the KNPLabs GitHub library via Composer and sets up a new client in the default route (and grabs the public user data for a user). He then shows how to change it up and use the Search API and some special queries to locate users by a given location. He adds another class, a "StarGazerCalculator", that's given the users returned, filters out the forks in the list and calculates the total "stargazer" count for the user. He does the same with the "top creators" list and sets it up as a service provider, fetches the data and returns the results as a JSON document.

0 comments voice your opinion now!
popular user language region github api silex tutorial

Link: http://www.sitepoint.com/popular-users-per-language-region-silex-github/

Laravelista.com:
Build an API with Lumen and Fractal
June 17, 2015 @ 10:16:58

On the Laravelista.com site there's a recent tutorial posted showing you how to create an API with Lumen and Fractal, a combination of the popular Laravel-based microframework and Fractal, an output handling library that makes it simpler to transform data to your needs. This is the second part of his series (part one is here), making some improvements on his previous examples.

In the previous post I used Larasponse to get Fractal working with Laravel, but recently I have switched to native Fractal package. One thing to notice is that in this post I will be showing you parts of code from a real project that I am working on called Treeline, instead of just example code like in the previous post. Be sure to check the Treeline repository if you're unclear on something.

He goes back through some of the setup process, getting Fractal installed via Composer and the creation of an ApiController to handle basic things like setting the status code and transforming the response to JSON. He shows how to add in the necessary routes for the "projects" path and creates the matching controller, collection and item classes that integrate the Fractal transformers to format their output as JSON. He also includes the code for the transformer classes themselves, showing you how to pull in and modify the data for the API's needs. He ends the post showing how to integrate other data (the "notes" into a "project" instance) and the resulting JSON output.

0 comments voice your opinion now!
lumen fractal api tutorial series part2 transform project note

Link: http://laravelista.com/build-an-api-with-lumen-and-fractal/

Hafiz Waheeduddin Ahmad:
API Testing Installing and Using Codeception
June 15, 2015 @ 15:45:41

Hafiz Waheeduddin Ahmad has a new post to his site, part three of a series he's posted on API testing, looking at the use of Codeception for testing API output and functionality.

In this post, we will have a look on how we can use Codeception for API testing.

He starts by helping you get Codeception installed through Composer through a "require" command line call. He then walks you through the setup of the project and how to use the "codecept" command line tool. He covers the generated directory structure the bootstrapping created and how to set up a sample configuration for your API. He then gets into writing an example test, showing how to check things like authentication, HTTP header information, response codes and response contents. Finally he shows how to run the tests in both a normal and more verbose way.

0 comments voice your opinion now!
api testing series part3 codeception introduction functional

Link: http://haafiz.me/development/api-testing-installing-and-using-codeception

SitePoint PHP Blog:
Exploring Github's Public Events with PHP and Google BigQuery
June 15, 2015 @ 13:10:14

The SitePoint PHP blog has a new tutorial posted showing you how to explore GitHubs public events through the GitHub API and handled via the Google BigQuery infrastructure taking the burden off your own systems.

If you've been following along with my previous articles about Github's API, you know that Github's developers are doing their best to ease the pain of interacting with Github data. In this article, we're going to take a look at the Github public events API and we will build a small demo along the way.

They start off with a brief introduction to both GiHub events (like pushes, merges, etc) and the BigQuery system and the problem it solves. They use a stock Laravel framework-based application (on a Homestead Improved VM) and add in the Google API credentials and a BigQueryServiceProvider using Google's own client to make the connection. They also set up a middleware authentication mechanism to redirect the user if they're not authenticated. They then move over to the BigQuery side and show how to use it's web-based console to perform queries and view results. They then translate this over to a simple "top ten" query, listing the top repositories ordered by number of forks. Building on this, they add in a simple form that allows the user to specify the language to search for (PHP, Javascript, etc) and outputs the results via a Blade template.

0 comments voice your opinion now!
google bigquery github event api tutorial topten forks

Link: http://www.sitepoint.com/exploring-githubs-public-events-php-google-bigquery/

php[architect]:
June 2015 Issue Released - APIs (and it's free!)
June 02, 2015 @ 13:48:38

php[architect] has a new post about the release of their latest issue (June 2015) - "APIs" - and how it's been made free for download.

That's right-thanks to Nexmo, June's issue on APIs is free of charge for the month! [...] The promise of Application Programming Interfaces (APIs) is really bearing fruit in today's Web. Of course, we are not talking about internal APIs but of HTTP-based ones that allow us to interact with external systems-whether its saving or searching images in Flickr, getting weather conditions, or transcoding video. For many tasks, if you sign up to use the right APIs, you can build a fully functional application by writing PHP scripts which coordinate the workflow and communications between APIs.

This issue includes articles like:

  • "SPOIL Your Users with Great Helper Libraries" (Keith Casey)
  • "High-Performance PHP APIs" (Simone Di Maulo)
  • "Putting the Pieces Together: Building APIs with Aura (and Other) Libraries" (Ian Littman)
  • "The API Toolbox" (Tim Lytle)

If you've ever been interested to see what php[architect] is all about or want to find out more about making and working with great APIs, be sure to grab your free copy today!

0 comments voice your opinion now!
phparchitect magazine june2015 issue release api free nexmo

Link: http://www.phparch.com/2015/06/june-issue-on-apis-free-download/

Phil Sturgeon:
The Importance of Serializing API Output
June 01, 2015 @ 09:50:16

Phil Sturgeon as a new post to his site today talking about the importance of serialized API output and why it's important to think about what to share and how they're shared.

One section that seems to get a lot of feedback and questions is when I talk about serialization, which I refer to as "adding a presentation layer to your data". [...] To PHP developers, they often consider serialization to be using the serialize() function. Yes, this is one form of serialization, but it's not the only one. Another common serialization approach is of course to use the json_encode() function. [...] Excuse the drastically simplified chunk of code here, but the point is we're taking a model (probably using an ORM) and returning the result directly. This seems fairly innocent, but leads to a range of problems.

He suggests that, when thinking about the data coming out of your API, you have to assume that every possible value could be shared if models are output directly. He gives the example of user passwords which, obviously, don't need to be shared at all. He includes an example of formatting the output with the Fractal library and why using something like that is important. He covers some of the topics to think about including attribute data types, renaming fields to make them more clear, the ability to pull from multiple data stores and the ability to version serializers. He ends the post with links to a few different serialization formats and some solutions (not just PHP ones) that can be used for the sort of handling he recommends.

0 comments voice your opinion now!
serialize api output json fractal datatype json tutorial versioning

Link: https://philsturgeon.uk/api/2015/05/30/serializing-api-output/

NoCapes Podcast:
Interview with Luke Stokes
May 25, 2015 @ 11:52:22

The NoCapes podcast has posted their latest episode, hosted by PHP community member Kayla Daniels. In this new episode she talks with Luke Stokes of FoxyCart.

In this episode of NoCapes, Luke Stokes discusses the journey towards hypermedia APIs, what is it and why hypermedia APIs are important.

You can watch this latest episode either on the NoCapes site or over on YouTube directly. If you enjoy the show you should subscribe to their mailing list and get more information as it's sent.

0 comments voice your opinion now!
nocapes podcast interview lukestokes api hypermedia foxycart

Link: https://www.youtube.com/watch?t=39&v=j43ZYS_wc8g

NetTuts.com:
E-mail List Alternatives With PHP Using Mailgun's List API
May 25, 2015 @ 08:12:15

In a new tutorial posted to the NetTuts.com site they show you an alternative method for sending emails from your PHP application: using the Mailgun API. This API provides an interface into the Mailgun service, specifically made for sending emails without the hassles of hosting your own email server.

Over the past couple years I've run into various frustrations with both open source email list applications and paid cloud-based providers. In this tutorial, I'll guide you through my adoption of Mailgun.com, an economical solution I've been using successfully now for two years. [...] Mailgun is a cloud-based SaaS email cannon, like SendGrid. It's actually free for up to 10,000 emails per month. Mailgun is incredibly powerful and offers a well-documented API in a variety of popular languages. It provides for both send and receive capabilities, the latter of which can be quite difficult to develop from scratch. While Mailgun doesn't provide templates for rich HTML newsletters, it provides a platform upon which you can build anything.

He shows you how to use the service using a simple "ListApp" application (found on GitHub here) that provides some of the most common email list management functionality. He shows you how to set up a free Mailgun account and where to find their PHP SDK for the PHP integration. He then gets into the code examples, showing how to connect to the API via the SDK and doing tasks such as:

  • Creating and update a mailing list
  • Importing members to a list
  • Showing a list of current list subscribers
  • Send a new message
  • Synchronizing lists and members

He ends the post with a quick section about extending the ListApp application (or the PHP SDK) with a suggestion to add better error reporting or a queue system to manage the remote API requests more efficiently.

0 comments voice your opinion now!
tutorial email list alternative mailgun api sdk listapp github

Link: http://code.tutsplus.com/tutorials/e-mail-list-alternatives-with-php-using-mailguns-list-api--cms-22824


Community Events

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


laravel list part2 language composer application opinion interview yii2 podcast programming introduction api example project community series php7 framework symfony

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