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

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

Damien Seguy:
Prepare for PHP 7 error messages (Series)
May 26, 2015 @ 09:35:11

For those looking forward to PHP 7, there's a new series of posts from Damien Seguy that can help you with some of the newer error messages and what might be causing them.

The first step to prepare for PHP 7 is to lint it : using the command line instruction 'php -l script.php', one can easily check that every file in a current application compile with PHP 7. The second step is to run the application and the unit tests : in short, execute it with PHP 7. And this is where we'll learn about the new errors that PHP has prepared for us. In order to be one step ahead of the migration, this article will help you prepare here is a panorama on PHP error messages.

In part one he looks at some of the most often raised errors including the incorrect use of "$this" and undefined offsets. Part two gets into a few more complex messages about return type hinting, the constant scalar expression and using temporary expressions in a write context. Finally, part three looks at messaging around redefinition of identical parameters, bit shifting by a negative number, named constructor deprecation and strict typing. Each part of the series covers a few more than just the ones listed here too, so be sure to check each for more helpful error messages and solutions.

0 comments voice your opinion now!
php7 error message help series part1 part2 part3 resolve information

Link: http://www.exakat.io/php-7-error-messages-part-1/

Phillip Shipley:
Creating a PHP Nexmo API Client using Guzzle Web Service Client - Part 3
April 10, 2015 @ 09: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.

0 comments voice your opinion now!
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/

Hailoapp.com:
A Journey into Microservices
March 11, 2015 @ 11:23:34

On the Hailo.com blog Matt Heath has posted a series of articles about their transition from a "monolith" codebase out into a set of microservices for the Hallo app system.

Hailo, like many startups, started small; small enough that our offices were below deck on a boat in central London - the HMS President. Working on a boat as a small focused team, we built out our original apps and APIs using tried and tested technologies, including Java, PHP, MySQL and Redis, all running on Amazon's EC2 platform. [...] After we launched in London, and then Dublin, we expanded from one continent to two, and then three; launching first in North America, and then in Asia. This posed a number of challenges-the main one being locality of customer data.

They describe this customer data problem in a bit more detail with the issue mostly revolving around the geolocation of the user and their information. They talk about "going global" and the steps they took to make the move. In the three parts of the series, they explain the changes they made and why they were effective for their application:

They end the series with some links to other resources that help compliment the subjects mentioned and link to slides from a presentation around the same topic.

0 comments voice your opinion now!
microservice journey series part1 part2 part3 introduction architecture api halloapp

Link: https://sudo.hailoapp.com/services/2015/03/09/journey-into-a-microservice-world-part-1/

NetTuts.com:
Create a Custom Payment Method in OpenCart Part 3
January 21, 2015 @ 10:20:44

NetTuts.com has continued their series showing how to integrate a custom payment method into your OpenCart instance with part three of the series. In this tutorial they focus more on the frontend aspects, creating controller and model handling for the new method.

If you've been following along with this series, you should be familiar with the kind of file structure we set up for our custom payment method in the back-end. [...] We'll use a similar kind of file setup for the front-end section as well.

He starts with the controller, building a handler for the Custom method, doing some data filtering and getting the order information. He walks you through what each of the lines are doing and shows how to output the result back to a view. He also includes the model code needed for the custom payment method as well as language/template files to display the form needed to gather the necessary data.

0 comments voice your opinion now!
opencart part3 series custom payment method tutorial

Link: http://code.tutsplus.com/tutorials/create-a-custom-payment-method-in-opencart-part-3--cms-22464

SitePoint PHP Blog:
Adding Products to Your eBay Store with the Trading API
January 13, 2015 @ 12:50:14

The SitePoint blog has posted the next part of their "using the eBay trading API" series today (part three) showing you how to add products to your store via their API.

In this third and final part of our eBay Trading API series, we'll be building the product adding functionality into our application. Now that we're done with the store settings, we can begin with writing the code for the controller that would handle the creation of products.

He walks you through the code to create the "new" action on your Slim controller, build the view to gather the product information and handle the upload of product images with the Dropzone Javascript library. Also included is the code to get the current category list (to populate a dropdown list) and the code needed to create the product, both in your database and sending it back to the eBay API for insertion. This finishes the series about using this API, but you can get more information on the API itself though its documentation. The full code for the tutorial series is available on GitHub.

0 comments voice your opinion now!
ebay trading api tutorial series part3 add product upload

Link: http://www.sitepoint.com/adding-products-ebay-store-trading-api/

SitePoint PHP Blog:
Developing PHP Extensions with C++ and PHP-CPP Advanced
January 08, 2015 @ 11:17:47

On the SitePoint PHP blog today Taylor Ren continues his look at using the PHP-CPP library to help build custom extensions. In this latest post he sheds some light on some more advanced topics.

In my earlier articles, I have introduced the PHP-CPP lib to create an extension for PHP using C++ (first article and second article). In the latter, I demonstrated a bit of the OO side of writing a PHP extension with a Complex class doing complex number manipulations. That introduction is not complete as the main focus of that article is more on the demonstration of the OO capability of PHP-CPP, not on the OO implementation details. In this article, we will further drill down the Complex lib development, adding more member functions, and addressing some advanced topics in writing a PHP extension with OO features using PHP-CPP

He breaks up the advanced topics into sections, providing code examples for each:

  • Returning this pointer in C++
  • Returning a Complex object pointer
  • Exposing the __toString magical method
  • Chaining member function calls
  • Exception throwing and handling in PHP

With the code in place, he then shows how to test all of the new functions you've added with a bit of simple PHP code.

0 comments voice your opinion now!
tutorial advanced extension cplusplus phpcpp series part3

Link: http://www.sitepoint.com/developing-php-extensions-c-php-cpp-advanced/

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 4 of 8)
September 05, 2014 @ 09:22:38

Matthew Weier O'Phinney has posted the latest tip in his Zend Server deployment series, part 4 related to securing the scripts you use for your jobs (like cron, but run through Zend Server).

This is the fourth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed a trick I learned about when to execute a chmod statement during deployment. Today, I'm sharing a tip about securing your Job Queue job scripts.

He talks about the security concerns around the scripts you use for your jobs and how to protect them since they're exposed to the world as public scripts (if their URL can be tracked down, that is). He shares a few lines of code that can help prevent that, though - a check to see if it's running as a job (via getCurrentJobId) and returning a "403 Forbidden" if not.

0 comments voice your opinion now!
zendserver deployment tips series part3 security jobid

Link: https://mwop.net/blog/2014-09-04-zend-server-deployment-part-4.html

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 3 of 8)
September 03, 2014 @ 09:34:51

Matthew Weier O'Phinney has posted the third article in his "Deploying Zend Server Tips" series today. In this tip he talks about file permissions and execution of shell commands.

In the first tip, I detailed writing deployment scripts. One of the snippets I shared was a chmod routine. [...] The code is fine; what I did not share is where in the deployment script you should invoke it. As I discovered from experience, this is key.

He points out that the deployment is run under a different user than the web server user. Future writes to those files by the web server could fail because of it, so he recommends running the permission change as the last step of the deployment script. If this ti was interesting and you'd like to check out more, you can find them in the first and second parts of the series.

0 comments voice your opinion now!
zendserver deployment tips series part3 chmod script

Link: https://mwop.net/blog/2014-09-02-zend-server-deployment-part-3.html

Matthias Noback:
Symfony2 Framework independent controllers parts 2 & 3
June 19, 2014 @ 09:45:34

Matthias Noback has posted the next two parts of his "framework independent controllers" series (it started here) looking at avoiding annotations and tying up some loose ends.

From part two about annotations:

In the previous part of this series we decreased coupling of a Symfony controller to the Symfony2 framework by removing its dependency on the standard Controller class from the FrameworkBundle. Now we take a look at annotations. They were initially introduced for rapid development (no need to create/modify some configuration file, just solve the issues inline!) [...] This might not seem such a big problem at all, but the SensioFrameworkExtraBundle is a bundle, which means it only works in the context of a Symfony2 application. We don't want our controller to be coupled like this to the framework (at least, that is the point of this series!), so we need to remove the dependency.

He shows how to decouple this functionality through a proper routing configuration, fetching the needed data yourself for the request and generating the request object yourself. In part three he covers some of the comments already made about the series and how to take the final steps to abstracting out the controllers: removing bundle names from templates, removing the HttpFoundation dependency and letting go of "action methods".

0 comments voice your opinion now!
controller independent symfony series part2 part3

Link: http://php-and-symfony.matthiasnoback.nl/tags/controller/


Community Events

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


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

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