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

SitePoint PHP Blog:
Build a Superfast PHP Server in Minutes with Icicle
Sep 17, 2015 @ 16:21:44

The SitePoint PHP blog has posted a new tutorial by Christopher Pitt showing you how to build a PHP server "super fast" with the help of the Icicle/http library and some event-driven programming techniques.

Event-based programming is a strange topic for PHP developers. In a language as procedural; events are little more than function calls. Nothing happens between events, and all meaningful code is still blocking.

Languages like JavaScript show us what PHP could be like if event loops were at the center. Some folks have taken these insights and coded them into event loops and HTTP servers. Today we’re going to create an HTTP server, in PHP. We’ll connect it to Apache to serve static files quickly. Everything else will pass through our PHP HTTP server, based on Icicle.

They start off showing you how to configure your Apache server to rewrite the requests (only for non-existent files) to the PHP handler. From there, he helps you get the Icicle/http library installed and create a simple HTTP server with it's included functionality. He shows how to set up routing using the LeagueRoute package and return correct HTTP response codes based on the result of the request. Finally he shows the use of the LeaguePlates library to render more complex views than just plain-text results.

tagged: tutorial http server icicle league plates route

Link: http://www.sitepoint.com/build-a-superfast-php-server-in-minutes-with-icicle/

Using Aura.Html with LeaguePlates
Mar 24, 2015 @ 15:51:13

Paul Jones has a new post to his site showing how to merge one of the components of the Aura framework with the templating library Plates, a part of the The League of Extraordinary PHP Packages. In this post he shows how to integrate the Plates rendering engine into the Aura.Html component for use as a view layer.

Aura has its own native PHP template package, Aura.View, a direct descendant of Savant and Solar_View, as well as a cousin to Zend_View. The v1 Aura.View package used to include a helper system. Once we realized that there was no reason to tie the helper system directly to the view system, we released the helpers as a standalone Aura.Html package. This means the helpers can be used in any PHP presentation code, framework-based or otherwise.

Plates lets you register functions against its own internal handling, referencing the different elements to be rendered. He includes a code example showing this integration and how they look used in a Plates template.

tagged: aura framework league plates templating library tutorial register

Link: http://paul-m-jones.com/archives/6111

Phil Sturgeon:
What is The League of Extraordinary Packages?
Oct 16, 2014 @ 15:48:29

In his latest post Phil Sturgeon talks about a project that's been running for a while, the The League of Extraordinary Packages and aims to clear up some recent misconceptions about the group and what they strive for in the projects they endorse.

This is the story of group of friends, who decided to write some code, but somehow confused and angered everyone with a keyboard. [...] Where should I release this code [I was super excited about releasing]? Should I release it with a vendor name of Sturgeon? That seemed rather egotistical. I could make something up, but what is the point of a single vendor with a single package? I wondered if any of my buddies were having this problem. [...] Being as hungover as I was, I thought long and hard, for about 5 seconds until something amazing happened in my brain... The PHP Super Best Friends Club! The guys loved it, and we started making plans immediately.

He goes on to talk about The League and some of the goals of the organization including the stated desire for quality code and a constant stream of work on the project (no abandoned or stale projects). He talks about how some of the rules for inclusion were created and some of the members of the various projects it includes. He then gets to the "recent misunderstanding" part of things with the clash of the League and the PHP-FIG (see here). He clears up some of the confusion in that thread by stating that:

  • League != PHPClasses
  • League != PEAR

He finishes off the post talking some about the leadership of the group (hint: it's an organization, not really run by a person or persons) and some of the work he's doing to ensure the future of the League and the packages it includes.

tagged: league extraordinary packages phpclasses pear compare rules community

Link: https://philsturgeon.uk/blog/2014/10/what-is-the-league-of-extraordinary-packages

Community News:
The League of Extraordinary Packages
Aug 16, 2013 @ 16:19:14

A new site has started up that's trying to provide a listing of the "highest quality packages" out there for PHP based on PHP-FIG standards and good practices - the League of Extraordinary Packages.

The League of Extraordinary Packages has one driving mission, to track down and develop PHP packages of the highest quality possible, using modern tools, standards and practices to distribute, test and strengthen the code.

Members of The League follow the standards put forward by the PHP-FIG, follow the best practices detailed by PHP The Right Way and distribute all code through Composer.

So far there's a few on the list, but it promises to grow quickly. Libraries already included are things like Geotools, oauth2-client and statsd.

tagged: league extraordinary packages composer phpfig phptherightway

Link: http://www.thephpleague.com


Trending Topics: