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

Matt Allan:
Writing Protobuf Services in PHP
Jan 29, 2018 @ 16:56:12

Matt Allan has a new post to his site sharing some of his experience in using PHP to write Protobuf services. Protobuf (short for "protocol buffers") are a language-agnostic data structure that allows for easy serialization.

Lately I’ve been investigating Protobuf as a replacement for JSON RPC services. If you aren’t familiar with Protobuf, it’s a language neutral serialization format from Google. It’s most commonly associated with Google’s RPC framework gRPC but it can be used standalone too. In this guide we are going to build a simple calculator RPC service using nothing but the Protobuf compiler and PHP.

The post starts by creating a ".proto" file, defining the structure of the data to be consumed. He includes the definition for the service itself, showing how to define a basic "Calculator" service with "add" and "subtract" methods. From there he defines the request and response formats for the data. The definitions are then compiled and classes are generated from the definitions. Switching to the PHP side, he sets up Composer autoloading and pulls in the google/protobuf package. Next comes the PHP code to work with the service and serving it up via the built-in server. Finally, he shares the code to create a client for the service and uses it to make some requests.

tagged: protobuf service protocolbuffer google tutorial webservice

Link: http://mattallan.org/posts/protobuf-php-services/

AWS Developer Blog:
Automating the Deployment of Encrypted Web Services with the AWS SDK for PHP (Pa
Feb 17, 2017 @ 18:25:48

The Amazon Web Services blog has posted the second part of their series covering the automated deployment of encrypted web services with the AWS SDK. In this new tutorial (part two, part one is here) they continue with the deployment of services: AWS Elastic Beanstalk, Amazon Route 53 and Amazon CloudFront.

In the first post of this series, we focused on how to use Amazon Route 53 for domain registration and use Amazon Certificate Manager (ACM) to create SSL certificates. With our newly registered domain available for use, we can proceed to deploy and configure the services we need to host the www.dev-null.link website across an encrypted connection. Once complete, the infrastructure configuration will reflect the diagrams [included in the post].

The tutorial then walks you through each of the services you need to deploy and shares the code (using the AWS PHP SDK) to show how to automate the process. There's also a few screenshots included of various page results and admin UIs to help you be sure you're in the right place.

tagged: aws amazon deployment encrypted webservice sdk tutorial series part2

Link: https://aws.amazon.com/blogs/developer/automating-the-deployment-of-encrypted-web-services-with-the-aws-sdk-for-php-part-2/

php[architect]:
Book Release: Integrating Web Services with OAuth and PHP
Feb 25, 2016 @ 20:08:17

php|architect has officially announced the release of their latest book: Integrating Web Services with OAuth and PHP from author and PHP community member Matt Frost.

Modern web applications are no longer standalone, monolithic codebases. Instead, they are expected to integrate with external, 3rd party applications to allow users to tap into new features, integrate with their social networks, and to easily migrate their data between systems. Many services afford these integrations by building web services that use the OAuth standard to authenticate users and allow “secure delegated access” on their behalf.

The book covers both of the major versions of OAuth currently in use (v1 and v2), how they differ and provides working PHP examples of both the client and server sides of the functionality. If you're interested you can "try before you buy" with an excerpt from the book to get a feel for the writing style and content. You can get more information and pick up a copy of your own directly from the php[architect] site.

tagged: server oauth webservice integrate release book client mattfrost

Link: https://www.phparch.com/books/integrating-web-services-with-oauth-and-php/

Phillip Shipley:
Creating a PHP Nexmo API Client using Guzzle Web Service Client – Part 3.5
Apr 13, 2015 @ 16:14:29

Phillip Shipley has continued his series about hooking your PHP application into the Nexmo API with this new update, part 3.5 of the series. It's a smaller follow up to the code and functionality introduced in part three with a quick implementation of some of the other API methods.

As I’ve hit on several times, using the Guzzle Web Service description way of developing an API client can save a lot of time. It took me a little less than an hour to finish adding support for these three sets of APIs. If I was writing every Guzzle client initialization and call individually it would have taken a lot longer I’m sure.

The process only takes four steps and the majority of that is just setup via Composer. In order to make things easier and so that you don't have to worry about the details of implementing each of the API features, he's just created a repository to bring all of that functionality in at once. He includes the code you'll need to add to use it as well (about the same as before, just with different client types).

tagged: nexmo api tutorial series part3plus guzzle webservice client repository

Link: http://www.phillipshipley.com/2015/04/creating-a-php-nexmo-api-client-using-guzzle-web-service-client-part-3-5/

Phillip Shipley:
Creating a PHP Nexmo API Client using Guzzle Web Service Client – Part 3
Apr 10, 2015 @ 14:25:40

Phillip Shipley has posted the next part in his series about making a client with Guzzle for the Nexmo API. In this latest post he adds functionality to the client made in previous parts of the series (part1, part two) to allow for message searching.

Now let’s go ahead and add another SMS related API to show how easy it is since we already have the base client and description in place. Nexmo also has APIs to search for a specific message, multiple messages based on some criteria, as well as for rejected messages. Let’s go ahead and add these three interfaces to our SMS description and see what it takes.

He includes the code to add to the current client and configuration to enable the "SearchMessage" functionality and the correct handling of the result. He shows how to update the client class with a new "searchMessage" method and the searching of the rejections with the Insight API.

tagged: nexmo api tutorial client guzzle series part3 webservice search rejected

Link: http://www.phillipshipley.com/2015/04/creating-a-php-nexmo-api-client-using-guzzle-web-service-client-part-3/

Phillip Shipley:
Creating a PHP Nexmo API Client using Guzzle Web Service Client – Part 2
Apr 09, 2015 @ 16:58:38

Phillip Shipley has posted the second part of his series (first part is here) about creating a PHP client for the Nexmo API with Guzzle, the popular PHP HTTP client.

In Part 1 of this series we laid a foundation for consuming the Nexmo SMS API and covered a few ways to interact with it. In this part we’ll create the actual Guzzle Web Service Client to interact with it to demonstrate how simple it can be.

He starts by getting Guzzle installed via Composer including a few extra components: guzzle-services, retry-subscriber and log-subscriber. He defines the structure (code) for the message to send to the Nexmo service. Next up is the creation of the actual client that takes in configuration settings and extracts the HTTP location and applies the provided credentials to the connection. Finally he makes a simple SMS client that extends this base client and puts it to use with a simple message defined in an array (to, from and text contents). The client then reports back the results in a simple nested array with response information from the Nexmo API.

tagged: nexmo client guzzle webservice api part2 series connect send

Link: http://www.phillipshipley.com/2015/04/creating-a-php-nexmo-api-client-using-guzzle-web-service-client-part-2/

Amazon Web Services PHP Blog:
Provision an Amazon EC2 Instance with PHP
Aug 23, 2013 @ 14:15:23

On the Amazon Web Services blog today Jeremy Lindblom shares a quick way you can use the AWS SDK to create an EC2 instance directly from PHP in just a few lines of code.

Amazon EC2 is a powerful AWS service that includes the ability to provision on-demand servers. While you can easily do this through the AWS Management Console, in this post, I want show you how to use the AWS SDK for PHP to do it programmatically by interacting with the Amazon EC2 API.

He starts with an outline of the steps (requiring a little bit of EC2-side configuration first) and shows how to use the SDK. His code sets up the client, creates the key pair and security group then is ready to make the instance. You can give the "runInstances" method a configuration that includes number of instances and what type. There's also some hooks back into the request that can tell you when the instances are running and how to get the path to the new instance (for ssh access).

tagged: amazon webservice api provision instance ec2 sdk tutorial

Link: http://blogs.aws.amazon.com/php/post/TxMLFLE50WUAMR/Provision-an-Amazon-EC2-Instance-with-PHP

Lukas Smith:
What is needed to REST in Symfony2
May 06, 2013 @ 15:24:05

Lukas Smith has a new post to his site that asks the question "what's needed to REST in Symfony 2?" In it he talks about some of the current issues surrounding REST support in Symfony (bundles) and a "call to arms" to create something better.

I think we already have quite a nice toolchain for REST in Symfony2 with Bundles like FOSRestBundle, JMSSerializerBundle, NelmioApiDocBundle, FSCHateoasBundle and HautelookTemplatedUriBundle. What is great about these Bundles is that they are all nicely integrated with each other. But there are still some limitations which should be addressed.

Some of the still outstanding issues he points out include issues with content-type and routing, dynamic content in the NelmioApi bundle, Behat context testing, JSONP support and more. He suggests gathering together a product backlog of these items and possibly making a kickstarter to fund its development.

tagged: rest api symfony2 webservice bundle missing features

Link: http://pooteeweet.org/blog/2221

Andi Gutmans:
Zend Server 6 is launched and available on the Amazon Web Services (AWS) Marketplace
Feb 21, 2013 @ 16:40:26

Andi Gutmans has a new post to his site about a recent update to the offerings on the Amazon Web Services (AWS) - it now offers Zend Server 6 as an installable option.

Zend Server 6 is the ideal application platform for mobile and web applications, and this version brings a new level of enterprise capabilities. [...] Today, I’m also pleased to share that this newest version of Zend Server is now available on the Amazon Web Services Marketplace. Now, for one combined fee with Amazon Web Services, you can run your applications on a fully supported PHP application platform with Zend Server 6 running on Red Hat Enterprise Linux or Ubuntu Linux.

If you're interested in what Zend Server has to offer, check out the product page on the Zend website. Zend Server handles a lot of the base level things for you and can help you get up and running quickly. It includes things like detailed monitoring, error tracking, code tracing and a nice UI to for management and configuration of the server.

tagged: zendserver aws amazon webservice server linux deploy

Link:

Martin Shwalbe:
Getting Started with REST and Zend Framework 2
Nov 13, 2012 @ 15:57:35

Martin Shwalbe has a new post that wants to help you get started using the Zend Framework 2 for creating REST web services quickly and easily.

Today i want to show you how to build a rest application. This tutorials assume you have completed the Getting Started. I will be repeating lot of the steps allready explained in there. There is also a sample Album module which you can install from here.

He starts off by setting up the Album module to load via the module autoloader and sets up its controllers and views in the module configuration. He shows how set up the REST routes (via the "router" in the module config), how to set up the view strategy and how to make a first controller. There's also a bit about testing this newly setup module with PHPUnit.

tagged: getting started introduction zendframework2 module rest webservice

Link:


Trending Topics: