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

Matt Stauffer:
Routing changes in Laravel 5.3
Jul 28, 2016 @ 09:36:05

In another of his series of posts about the upcoming version of the Laravel framework (v5.3) Matt Stauffer focuses in on some of the changes in routing that are coming down the line.

The last few versions of Laravel have showed the way routing works shifting around a bit. This is usually a sign that we're feeling some sort of pain—something feels off—but haven't found the perfect solution yet. In 5.3, we may have found it.

He starts by looking at some of the routing changes that happened when v5.2 was released including the change away from two groups ("web" and "api"). In v5.3 the major change is the location of the routes definitions containing all of the routes in your application. In the update, this relocation (into a directory) allows you to define multiple route configurations that can be individually changed based on features rather than one global place. He also includes an example of how you can set up your RouteServiceProvider to load in custom configurations as well.

tagged: laravel v53 routing changes directory multiple files configuration

Link: https://mattstauffer.co/blog/routing-changes-in-laravel-5-3

SitePoint PHP Blog:
Appserver – Server Configuration, Dir Structure and Threads
Feb 01, 2016 @ 09:25:05

The SitePoint PHP blog continues their series looking at the features of the appserver.io project in this second post covering its server configuration, directory structure and how it handles threads during processing.

In the first part of our Appserver series, we discussed the very high level differences of Appserver’s architecture to standard web server stacks and got you up and running with an Appserver instance.

[...] In this part, we will be exploring the Appserver architecture a bit more in depth. We will go through the concepts of the different contexts and the parts of Appserver you get out of the box, which cover some of the ground most of the popular PHP frameworks offer. We will also configure the web server and look into an application’s structure. Once we are finished, you should have a fair understanding about Appserver’s contexts in relation to threading, the web server, and its setup.

They start with the threading functionality, showing how "contexts" come in to play and how the code executes as long as this context is alive. The post then gets into some of the code-related differences with using appserver such as extra annotation handling and AOP (aspect oriented programming) practices. From there they get into the tech behind the scenes: configuring the web server, setting up a virtual host and pointing it at the sample application. Finally they talk about the servlet engine and the server's directory structure underneath.

tagged: appserverio project opensource server configuration directory structure thread processsing

Link: http://www.sitepoint.com/appserver-server-configuration-dir-structure-and-threads/

How the Directory Structure Has Changed in Laravel 5
Apr 16, 2015 @ 09:47:47

On the NetTuts.com site today they have a new tutorial (screencast) posted showing what the changes are in the directory structure of Laravel 5.

The newest version of Laravel was released in February, and the most noticeable change in version 5 is the new directory structure. In this short video tutorial, I'll explain exactly what's changed and why.

The video is a part of a larger series and is one of two free videos for it. The remainder of the series covers things like middleware, contracts, events, forms and validation as well as the command bus and its use.

tagged: laravel5 screencast directory structure change tutorial series

Link: http://code.tutsplus.com/articles/how-the-directory-structure-has-changed-in-laravel-5--cms-23795

Paul Jones:
PSR-4 "Autoloader" Has Passed
Dec 04, 2013 @ 10:37:51

As Paul Jones mentions in his latest post, one of the latest proposals to the PHP-FIG (Framework Interoperability Group) has officially passed, PSR-4, providing a more strict standard for autoloading than the widely used PSR-0.

Counting from the date of that first formal proposal, it has taken exactly 8 months of discussions, one botched vote, one rescinded vote, an entirely new FIG workflow, and four or five rewrites to get PSR-4 passed. Maybe 8 months doesn’t sound so long when you look back on it, but while you’re in the middle of it, it’s interminable.

Paul talks about some of the differences between it and PSR-0, making for "shallower" and more concise directory structures for packages. He also points to some of the packages from the Aura framework as examples of its implementation.

tagged: psr4 autoloader phpfig proposal vote pass directory structure namespace

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

Community News:
PSR-4 Autloader Proposal now in Draft Status
Aug 23, 2013 @ 12:05:41

As is mentioned in this Reddit post, the PHP-FIG group has moved a new autoloader structure proposal into "Draft" status, making it past the initial proposal (Entrance Vote) level as PSR-4.

This new autoloader has been in the works for a while, and is meant to be a modern autoloader that reflects the changes in the PHP landscape since PSR-0 was originally put together. Yesterday it passed the Entrance Vote, which means its now a formally worked and supported by the FIG.

While PSR-0 is new to many, its been around for years - since before Composer was really a thing - and PEAR/SF1/ZF1 were the prominent sources of distributed code. Now that so many are building components with Composer and using PSR-0 (yay) it's about time a new standard took care of a few hangovers from the PEAR/Zend style.

The newly proposed autoloader gets rid of some of the allowances that PSR-0 included like proper namespace support (no more underscores) and a reduction in the required folder structure to make it work. The Composer project is also a part of these discussions and are on board with making these proposed changes in the project's autoload handling.

We'd love to get constructive feedback on PSR-4. Post stuff up here, on the mailing list, get in #phpfig on freenode, whatever, just get involved. That doesn't mean everything will be implemented, but there is more chance of the standard containing your feedback if you make it - so post something.
tagged: phpfig psr4 autoloader draft vote composer namespace directory

Link: http://www.reddit.com/r/PHP/comments/1kvr1f/the_new_autoloading_standard_psr4_passes_entrance

PHP internationalization with gettext tutorial
Jul 17, 2013 @ 09:41:37

On Lingohub.com there's a recent tutorial posted about using gettext for the internationalization of your application. The gettext functionality lets you define POT files (portable object templates) that contain the strings for the given language.

GNU gettext is a package that offers to programmers, translators and even users a well integrated set of tools that provide a framework within which other free packages may produce multi-lingual messages. [...] In this tutorial we want to document how PHP internationalization with gettext works. It covers setup, use and best practice.

They go through the installation of both the gettext software and how to get support for it built into PHP. There's a detailed guide to creating the POT files and the formatting you can use to define things like simple messages, plurals and multiple response messages. An example file is included to illustrate. They also talk about the directory structure to use and how to get it working in PHP (sample code).

tagged: gettext tutorial install configure pot file directory

Link: http://blog.lingohub.com/2013/07/php-internationalization-with-gettext-tutorial

Rob Allen:
Thoughts on module directory structure
Jan 04, 2013 @ 09:09:55

Rob Allen, in his Zend Framework 2 development, has come up with a list of suggestions about the use of modules in your applications, mainly relating to the structure of the files inside of them.

I've been working on a Zend Framework 2 module within a larger project that doesn't have that many PHP class files. Specifically, it has a controller, a mapper, an entity, a service and a form. As a result, the traditional Zend Framework 2 directory structure for the Account module looks [overly complicated]. That's a lot of directories for not many files! As a result, I decided to flatten it to [something simpler].

He includes both the "before" and "after" directory structures and continues on with two more suggestions - the removal of the top level "Account" folder inside of "src/" and, finally, removing "src/" all together with a slight modification to the autoloading. With a simpler module, though, something like this might make it easier to maintain and "follow" later down the road.

tagged: zendframework2 module structure directory minimal


List Files and Directories with PHP
Oct 23, 2012 @ 08:56:25

On PHPMaster.com there's a new tutorial showing you how to work with files and directories through your PHP applications.

In this article I’ll talk about a common task you might have experienced while developing a PHP application: listing files and directories. I’ll discuss several basic and advanced solutions, each having its pros and cons. First I’ll present three approaches that use some very basic PHP functions and then progress to more robust ones which make use of SPL Iterators.

The solutions they look at are the built-in functions like glob and readdir/opendir as well as SPL iterators up for the task - FilesystemIterator, RecursiveDirectoryIterator and GlobIterator. Code samples are included in the post, showing how to use each method to get and list the files. A few helpful hints are also included to finish off the tutorial (mostly about "tricks" to using the functions effectively).

tagged: tutorial file directory list spl iterator


Using SPL Iterators, Part 1
May 15, 2012 @ 12:26:59

On PHPMaster.com today there's a new tutorial posted, the first part of a series, looking at the use of the Standard PHP Library (SPL) in PHP. In this first part of the series, Stefan Froelich looks specifically at two of the more common uses for iterators - working with arrays and directories.

When I first came across the term iteration and saw the overwhelming list of classes related to it in the SPL, I was taken aback. It seemed maybe iteration was too complex for me to grasp. I soon realized it was just a fancy word for something we programmers do all the time. [...] In the first part of this two-part series I’ll introduce you to iteration and how you can take advantage of some of the built-in classes from the Standard PHP Library (SPL).

Included in the tutorial is example code showing how to use the ArrayIterator to work with an array and the DirectoryIterator to process the contents of a directory. He also briefly touches on a few other iterators like "FileExtensionFilter", "RecursiveDirectoryIterator" and "RecursiveArrayIterator".

tagged: spl iterators tutorial array directory file recursive


Job Posting:
Worldwide Travel Directory Seeks LAMP Consultant (New York City, NY)
Sep 15, 2010 @ 12:29:44

Company Worldwide Travel Directory
Location New York City, NY (Downtown)
Title LAMP Consultant

A worldwide travel directory is seeking a sharp and well-qualified LAMP consultant to work on an online reservation system. This is an outstanding temporary opportunity for a highly analytical IT professional with substantial e-commerce experience, to join a advanced and growing atmosphere! Please consider this position by applying today for immediate consideration.

NOTE: Position is contract but could become long-term/permanent for the right fit.

Company Description
Worldwide Travel Directory

Job Description
In this short-term, temporary position, the LAMP Consultant will work on an online reservation for a worldwide travel directory. Candidates must come from an e-commerce background and have 5+ years of programming experience with Linux, Apache HTTP Server, MySQL, and PHP.

Required Skills

  • 5+ years of programming experience with Linux, Apache HTTP Server, MySQL, and PHP
  • Substantial e-commerce experience
  • Excellent written and verbal communication skills
  • Strong ability to work autonomously
  • Highly analytical
  • Experience with all phases of application development from initial design through deployment
  • Ability to interpret and analyze existing code base

Desired Skills

  • Experience in developing mobile apps
  • Prior exposure to online booking and travel development. i.e. Expedia, Travelocity, or similar

    For more information or to submit your resume, contact Michael J. Pisano at MPisano@execu-search.com.

tagged: job ny newyork lamp consultant travel directory job