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

Abdul Malik Ikhsan:
Using Routed Middleware class as Controller with multi actions in Expressive
Jan 06, 2016 @ 17:54:38

In this post to his site Abdul Malik Ikhsan shows you how to use a middleware class that does some extra routing as a "controller" in your Zend Expressive application.

If you are familiar with frameworks with provide controller with multi actions functionality, like in Zend Framework 1 and 2, you may want to apply it when you use ZendExpressive microframework as well. Usually, we need to define 1 routed middleware, 1 __invoke() with 3 parameters ( request, response, next ). [...] What if we want to use only one middleware class which facilitate [multiple] pages?

He shows how to take a sample route configuration for an "album" endpoint and handle it via an AbstractPage class that performs a bit of reflection on the request to route things the right way. Then the "controller" is created by extending this abstract class and functions are defined for each action, complete with access to the request, response and next middleware objects.

tagged: zend zendexpressive routing middleware controller reflection actions tutorial

Link: https://samsonasik.wordpress.com/2016/01/03/using-routed-middleware-class-as-controller-with-multi-actions-in-expressive/

AWS Development Blog:
Preview the AWS Resource APIs for PHP
Jan 06, 2015 @ 16:32:37

On the AWS development blog Jeremy Lindblom has a recent post with a preview of the AWS resource APIs for PHP and the AWS SDK for PHP.

This year is just about over, but we are too excited to wait until the new year to share with you a feature we are developing for the AWS SDK for PHP. We are calling it the AWS Resource APIs for PHP. This feature is maintained as a separate package, but it acts as an extension to Version 3 of the AWS SDK for PHP.

He talks about the new resource objects that contain information to identify what it represented (like a S3 bucket or SQS queue) and includes an example object structure. He shows how to perform actions on the objects and working with collections. He also includes a helpful hint about using the "respondsTo" method on the object to get the methods the object can use.

tagged: aws resource api sdk update feature object actions collections

Link: http://blogs.aws.amazon.com/php/post/Tx3K1TS5GUKJR85/Preview-the-AWS-Resource-APIs-for-PHP

NetTuts.com:
More Tips for Best Practices in WordPress Development
Jul 25, 2014 @ 14:18:09

NetTuts.com has published a few more WordPress tips and best practices to help you get the most out of your WordPress-based application.

Welcome to the second part of the series. In the first article, we explained the WordPress Coding Standards, how to avoid namespaces collisions, comments in the code, and some basic security tips. Today, we are going to go a bit deeper and write some more code and learn some techniques to improve performance and security of our plugins.

They look specifically at when you should include your scripts and styles, formatting Ajax calls and working with filters and actions. Code snippets are included with each point with links to some other resources for some of the topics to provide more information.

tagged: wordpress bestpractices development ajax scripts styles filters actions

Link: http://code.tutsplus.com/articles/more-tips-for-best-practices-in-wordpress-development--cms-21013

PHP.net:
A further update on php.net
Oct 25, 2013 @ 15:20:05

As many probably noticed yesterday, the entire PHP.net domain (subdomains and all) were marked by the Google Safe Browsing service as potentially harmful. The issue has been discovered and resolved so things are back to normal, but the development group wanted to provide an update as to the current status.

We are continuing to work through the repercussions of the php.net malware issue described in a news post earlier today. As part of this, the php.net systems team have audited every server operated by php.net, and have found that two servers were compromised: the server which hosted the www.php.net, static.php.net and git.php.net domains, and was previously suspected based on the JavaScript malware, and the server hosting bugs.php.net. The method by which these servers were compromised is unknown at this time.

The post talks about some of the actions taken since the compromise and more details about what happened. It all revolved around a malicious Javascript file that was served to some visitors of the site. For more information as it becomes available, check back with the main PHP.net site or follow official_php on Twitter.

tagged: phpnet website compromise javascript actions

Link: http://blog.sznapka.pl/testing-in-isolation-with-symfony2-and-webtestcase


Trending Topics: