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

Zend Framework Blog:
Nested Middleware in Expressive
Mar 16, 2017 @ 11:52:21

On the Zend Framework blog Matthew Weier O'Phinney has posted another tutorial, this time showing you how to use nested middleware in Expressive allowing for the composition of your own workflow in the request/response flow.

A major reason to adopt a middleware architecture is the ability to create custom workflows for your application. Most traditional MVC architectures have a very specific workflow the request follows. While this is often customizable via event listeners, the events and general request lifecycle is the same for each and every resource the application serves.

With middleware, however, you can define your own workflow by composing middleware.

He starts by describing one of the main concepts in the workflow of the application: pipelines. He gives an example of the default pipeline included with the Expressive skeleton application and how the middleware it uses nests to create a custom logic and handling flow. He follows this with an example scenario showing how to add authentication into the pipeline, specifically the use of Digest authentication via a PSR7 middleware package. Code is included for the integration of this package and the end result - all pages requiring authentication. He shows how to modify this and limit it to only certain paths and how to nest them in the route definitions.

Finally he shows another approach - creating a custom middleware pipeline inside of the factory for the requested middleware. He also covers nested applications, using traits for common workflows and the use of "delegator factories".

tagged: expressive tutorial nested middleware pipeline custom authentication example

Link: https://framework.zend.com/blog/2017-03-15-nested-middleware-in-expressive.html

Fabian Schmengler:
Collection Pipelines in PHP
Dec 28, 2016 @ 12:24:24

In a new post to his site Fabian Schmengler has written up an introduction to collection pipelines and how it could be applied to a Magento-based environment.

If you read the book “Refactoring to Collections” or saw screencasts and talks by Adam Wathan about collection pipelines, but do not work with Laravel, you might have asked yourself how to apply these techniques to other PHP applications, for example Magento.

[...] This is very similar to Unix pipes, where the individual commands are the operations, and the lines passed through input and output stream, the collection.

He starts by illustrating the idea in Bash and Ruby, showing the three main types of collection operations: map, filter and reduce. He talks about the advantages these methods have over traditional looping and what kind of value they can provide in both Laravel and plain old PHP. He illustrates the PHP-only versions using the array_filter, array_map and array_reduce functions and some thoughts on when it's good to use them over normal looping (and when it's not). He then gets into the Magento-specific handling and making use of a package to handle collections: Knapsack. He shows how to use the library to work with collections and, as another option, a "home-grown" version that lives in a single class. The post wraps up with the Magento integration of this functionality, a brief mention of functional programming and "the hard part" of issues with debugging.

tagged: collection pipeline package knapsack magento integration tutorial introduction map reduce filter

Link: https://www.schmengler-se.de/en/2016/12/collection-pipelines-in-magento/

Ben Ramsey:
Building PHP Projects on AWS CodeBuild
Dec 05, 2016 @ 10:54:48

Ben Ramsey has a post to his site sharing the process he's worked up to deploy PHP applications on AWS Codebuild, a new service from Amazon Web Services that fills the niche for an easy to spin up and use build server.

The main highlight of re:Invent is always the keynotes and the new services and features announcements they make during the keynotes. One of the new services caught my attention, and I decided to give it a try. That service is AWS CodeBuild.

CodeBuild is designed to be used as part of the AWS CodePipeline, but it may also be used by itself. [...] Out of the box, CodeBuild provides some managed images that you may use to build your projects. These include environments for Android, Java, Python, Ruby, Golang, and Node.js. PHP is missing from this list, but since you’re able to use other images, I decided to see how easy it is to get up and running on CodeBuild with a PHP project. I chose to try out my ramsey/uuid library for a simple test.

He walks you through the creation of a new CodeBuild instance (complete with screenshots of the UI) and how to configure your project, explaining each of the settings as he goes. He includes the full build command he's using for the library running tests, a lint check and codesniffer checks for formatting. He shows how to get the project to build and what the UI will show when the build is successful (all green).

tagged: project aws codebuild pipeline library tutorial setup build server amazon

Link: https://benramsey.com/blog/2016/12/aws-codebuild-php/

Chris Jones' Blog:
Speeding up DBMS_OUTPUT in PHP OCI8
Oct 27, 2008 @ 08:48:59

In this new post to his Oracle blog, Chris Jones shows how to set up DBMS_OUTPUT to work with the OCI8 extension available for PHP.

Immediately after OOW, Alison and I have got straight into updating the Underground PHP & Oracle Manual. We've had our heads right down. [...] When reviewing the DBMS_OUTPUT section I tried using a PIPELINED PL/SQL function and found a significant speed improvement over the basic method.

He shows a few different methods for getting it working and includes both the code, SQL to create the functions and a bit of stats at the end showing which method is the fastest (the pipelined version wins out by quite a bit every time).

tagged: pipeline oci8 dbmsoutput function tutorial statistics

Link:

H3rald.com:
Rails-inspired PHP frameworks
May 05, 2006 @ 07:21:19

The H3rald site has posted a new article that looks at a collection of PHP frameworks that have been inspired by Rails' example.

There are various articles online examining many PHP frameworks, providing short reviews or comparative charts, but I could not find yet an article examining the so called "Rails-inspired frameworks" anywhere on the web, so I decided to write my own…

I'm talking about those PHP frameworks who give at least part of their success to Ruby on Rails2, but don't call them clones or ports as some of their creators may get offended.

He comments on how Rails' entrance into the world of the web was a "shocking" experience and how, as soon as developers saw the benefits of an easy to use "semi-sentient" web development framework, they jumped on board - including several PHP developers out there. To illustrate the point, he gives six PHP frameworks up as examples:

Under each example, there's a list of the license, size, databases supported, a tutorial, and a description of the framework (including the pros and cons of using it). He also includes a few comments on each with his personal opinions and a few extra facts thrown in.

tagged: rails inspired framework cakephp symfony phpontrax codeigniter pipeline rails inspired framework cakephp symfony phpontrax codeigniter pipeline

Link:

H3rald.com:
Rails-inspired PHP frameworks
May 05, 2006 @ 07:21:19

The H3rald site has posted a new article that looks at a collection of PHP frameworks that have been inspired by Rails' example.

There are various articles online examining many PHP frameworks, providing short reviews or comparative charts, but I could not find yet an article examining the so called "Rails-inspired frameworks" anywhere on the web, so I decided to write my own…

I'm talking about those PHP frameworks who give at least part of their success to Ruby on Rails2, but don't call them clones or ports as some of their creators may get offended.

He comments on how Rails' entrance into the world of the web was a "shocking" experience and how, as soon as developers saw the benefits of an easy to use "semi-sentient" web development framework, they jumped on board - including several PHP developers out there. To illustrate the point, he gives six PHP frameworks up as examples:

Under each example, there's a list of the license, size, databases supported, a tutorial, and a description of the framework (including the pros and cons of using it). He also includes a few comments on each with his personal opinions and a few extra facts thrown in.

tagged: rails inspired framework cakephp symfony phpontrax codeigniter pipeline rails inspired framework cakephp symfony phpontrax codeigniter pipeline

Link:

Community News:
The Pipeline Project (MVC-based Framework)
Jan 03, 2006 @ 07:02:08

Ryan Johnson over at the Pipline Project emailed in today to let us know about their project, Pipeline, an MVC-based framework that's targeting itself at "the little guy" sites out there.

The project is in its very early stages, and so we ask you to know that there will be more to come, and that this is just the first developer preview. However, we can stand behind it in our belief that it's a highly evolved specimen, and will be of interest to anybody developing web applications, or just writing about them. In the future we will be releasing commercial products under the Livepipe brand, but for now all of the work we are announcing today, or in the near future, will be released under the MIT license for all to enjoy.

You can grab the latest version (their first developer preview of Pipeline) from their download page, or check out their roadmap and blog for more...

tagged: framework mvc model view controller livepipe pipeline framework mvc model view controller livepipe pipeline

Link:

Community News:
The Pipeline Project (MVC-based Framework)
Jan 03, 2006 @ 07:02:08

Ryan Johnson over at the Pipline Project emailed in today to let us know about their project, Pipeline, an MVC-based framework that's targeting itself at "the little guy" sites out there.

The project is in its very early stages, and so we ask you to know that there will be more to come, and that this is just the first developer preview. However, we can stand behind it in our belief that it's a highly evolved specimen, and will be of interest to anybody developing web applications, or just writing about them. In the future we will be releasing commercial products under the Livepipe brand, but for now all of the work we are announcing today, or in the near future, will be released under the MIT license for all to enjoy.

You can grab the latest version (their first developer preview of Pipeline) from their download page, or check out their roadmap and blog for more...

tagged: framework mvc model view controller livepipe pipeline framework mvc model view controller livepipe pipeline

Link: