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

Building a Welcome Page for Your WordPress Product: Code Part 1
Sep 23, 2016 @ 10:33:58

TutsPlus.com has started off a new series of posts for the WordPress users out there showing you how to build a "welcome page" for your WordPress site and product.

In the first two articles of this series, I wrote about what welcome pages are and how they are helping products improve user experience by connecting the dots, after which I wrote about the WordPress Transients API that I intend to use while building the welcome page.

Coding a welcome page for your WordPress plugin can be a tricky process. The entire concept revolves around redirecting users to a particular page via setting transients and finally deleting them. Let's start building the welcome page.

They walk you through the creation of a simple plugin that can be used to easily create (and re-create) these "welcome" pages (the final result is here for the impatient). The tutorial the starts off by defining the architecture of the plugin and the workflow that it will follow to generate the page. From there it gets into the code for the plugin itself and related supporting files including the "initializer" that activates the plugin, making it ready for use.

tagged: welcome page wordpress plugin series part1 tutorial

Link: https://code.tutsplus.com/articles/building-a-welcome-page-for-your-wordpress-product-code-part-1--cms-26014

QaFoo Blog:
Introduction To Page Objects
Sep 06, 2016 @ 11:03:17

The QaFoo blog has a post to their blog introducing page objects and how they're useful in functional testing to help provide a "decoupling" from the actual frontend.

A while ago we wrote about writing acceptance tests (end-to-end tests) with Mink and PHPUnit. While this is a great set of tools for various applications such tests tend be susceptible to changes in the frontend. And the way they break is often hard to debug, too. Today I will introduce you to Page Objects which can solve some of these problems.

The basic idea behind a Page Object is that you get an object oriented representation of your website. The Page Objects maps the HTML (or JSON) to an object oriented structure you can interact with and assert on. This is more initial work then than writing tests with PHPUnit and Mink directly, but it can be worth the effort.

They use the Mnk testing tool to simulate a browser and some previously shared functionality to lay the foundation. From there they write up a first test using a "Login" page object and processing the username/password handling of the page. They show how to implement a custom page object with a bit of additional logic and put it to use in processing the request. They also include an update when, for example, a site is switched from Twig templates to a React.js component and how the Page object would need to be refactored for the update.

tagged: page object functional test mink behat example tutorial

Link: https://qafoo.com/blog/089_introduction_to_page_objects.html

Laravel News:
How to Create A Most Popular List with Laravel and Google Analytics
Sep 02, 2016 @ 09:40:16

On the Laravel News site there's a new post showing you how to make use of the Google Analytics API in your Laravel application to find trending content in your site (most accessed pages).

Here on Laravel News, I wanted to generate a list of the most popular posts for the past seven days and display the results from most popular to least popular. To solve this problem I thought of two solutions. The first is to build my own tracking system so I could keep a count and then use it for ordering. However, that could generate a huge amount of data and it seemed like a solution that an analytics tracking service could handle.

As I was fumbling through the Google Analytics API I found a Laravel Analytics package by Spatie.be that allows you to easily retrieve data from your Google Analytics account and it seemed like the best way to solve this problem. Let’s look at how I used it to generate a list of popular posts here on Laravel News.

They then walk you through the installation (via Composer) and configuration of the library. This includes linking to more information about setting up the credentials for the connection. They then show how to use it to fetch the most popular pages and what the response looks like as a collection. Finally they show you how to create a wrapper class you can easily reuse anywhere in your application to fetch and display this "trending" information". The post ends showing you how to create a "View Composer" that only fires when the view is being rendered, not on every request.

tagged: laravel googleanalytics trending popular page results tutorial package

Link: https://laravel-news.com/2016/09/most-popular-list-laravel-google-analytics/

Julien Pauli:
Huge Page usage in PHP 7
Oct 30, 2015 @ 12:16:48

In this post to his site Julien Pauli looks at the concept of "huge pages" and how it relates to some of the behind the scenes work done in PHP 7 to improve memory usage.

Memory paging is a way Operating Systems manage userland process memory. Each process memory access is virtual, and the OS together with the hardware MMU must translate that address into a physical address used to access the data in main memory (RAM).

Paging memory is dividing memory in chunks of fixed size, called pages. [...] Why use huge pages? The concept is easy. If we make the OS Kernel use bigger page sizes, that means that more data can be accessed into one single page. That also means that we'll suffer from less TLB miss, once the page translation is stored into the TLB, because one translation will now be valid for more data.

He briefly covers how some updated memory handling and opcode restructuring helps PHP 7 perform even better, especially when it comes to the OPCache handling. He talks about the changes made in the extension specifically to support the "huge pages" idea, complete with code examples (in C) of how this was accomplished.

tagged: huge page php7 memory improvement performance opcache

Link: http://jpauli.github.io/2015/10/28/huge-page.html

SitePoint PHP Blog:
Using BoltCMS to Build a Small Business Website
Apr 21, 2015 @ 12:12:23

The SitePoint PHP blog has a new tutorial posted showing you how to set up a simple small business website using the BoltCMS tool. This recent article will walk you through the full installation, configuration and setup for a simple site including database interactions.

As the web continues to mature and the demand for the efficiency of content delivery increases, more and more slim and trim CMSs are coming into the fray. Developers (front-end and back-end) are branching away from the heavy-hitters like WordPress and Drupal, and into the likes of more streamlined, tailor-made solutions. Bolt CMS is one of these CMSs, and prides itself on being a dream for designers, developers, and content editors alike.

He starts with a brief overview of what the BoltCMS has to offer and some of the technology that powers it. He then goes through each of the steps to get the application up and running:

  • Requirements, setup and installation
  • Main configuration and theme set up
  • Splitting up files into templates
  • Introducing and creating content types
  • Retrieving content from database records

Each step along the way includes the code, configuration changes or template updates you'll need to make to end up with a simple site allowing you to view a page of content and list/add related testimonials.

tagged: boltcms small business website tutorial page testimonial

Link: http://www.sitepoint.com/using-boltcms-build-small-business-website/

New Supported Versions Timeline Page
Oct 29, 2014 @ 11:18:40

The PHP.net website has introduced a new feature to help make it a bit clearer which versions of PHP are supported and which have reached their end-of-life mark. This new Supported versions page off the main site provides listings of currently supported versions and graphical timelines of past (and future) support milestones.

Each release branch of PHP is fully supported for two years from its initial stable release. During this period, bugs and security issues that have been reported are fixed and are released in regular point releases. After this two year period of active support, each branch is then supported for an additional year for critical security issues only. Releases during this period are made on an as-needed basis: there may be multiple point releases, or none, depending on the number of reports.

The page includes information on when the initial release in a series was made (like the 5.4.x or 5.5.x series), when active support did/will end and how long the timeline is for security fixes and support. As of the time of this post, PHP 5.3.x is the only series that has reached end-of-life, but the 5.4.x series is coming close being in security fix only mode now and EOL-ing completely in ten months.

tagged: version support timeline page phpnet release bugfix security

Link: http://php.net/supported-versions.php

Matthew Weier O'Phinney:
Deployment with Zend Server (Part 6 of 8) - Page Caching
Sep 11, 2014 @ 14:57:08

Matthew Weier O'Phinney has posted his sixth part (of eight) in his "deployment with Zend Server" tips and tricks. In this latest post he talks about page caching.

This is the sixth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed setting job script status codes. Today, I'm sharing some tips around setting up page caching, and jobs for clearing the Zend Server page cache.

He starts off describing what Zend Server offers in the way of page caching and provides an example (with screenshots) of how he sets his up to work with multiple subdomains. He then shows how to set what variable the caching looks at to tell the difference between pages and how to clear the cache on deploy. He includes a simple script to help with that, running through a list of paths and calling the flush on each.

tagged: zendserver deployment tips series part6 page caching

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

Cal Evans:
Step 0 when hiring PHP developers online. Get this right!
Aug 12, 2014 @ 09:25:31

Cal Evans has a new post to his site with a great suggestion for those looking to hire PHP developers: get your jobs page right and show that you have a good "developer culture" to attract good, solid talent.

When building an online strategy for finding developers to hire, start with your web site. It is amazing that so many companies miss this totally or mess this step up. Make sure you have a top level menu item that is easy to identify as “this is where we post jobs”. Call it “Jobs”, “Careers”, “Work with us” whatever, just make sure it’s in the top level of your menu and not something that people have to dig down into your site to get to.

He also suggests that you treat the "Jobs" page as an important part of the site. Vague or incomplete descriptions of the positions turn off developers and will make them move on to something else. Link to the deeper details and don't overwhelm the viewer with it all up front. He gives two examples of companies that he thinks have gotten it right and how it reflects on their investment in developer culture.

So step 0 in the process of finding developers to work on your team is to build a culture of respect. If you get this right, attracting developers – attracting the best developers – will be easy. Get this wrong though, nothing else will matter. Remember, developer talk to each other within their community. They will know if you are not a good place to work.
tagged: hiring developer jobs page step0 culture

Link: http://blog.calevans.com/2014/08/11/step-0-when-hiring-php-developers-online-get-this-right/

Paul Jones:
"Page Script" As A Degenerate Controller
Feb 04, 2014 @ 12:26:52

In his latest post Paul Jones looks at the more legacy structure of "page controllers" (a site based on several pages rather than an MVC style) that was common before the "MVC revolution" in the PHP community years back.

Almost all of the legacy applications I’ve had to deal with were page-based. In doing the work to modernize them, there comes a time where the page script has been refactored to look very much like a page controller, with some distinct but not critical differences. As such, I have come to consider the typical PHP page script to be a degenerate form of a page controller. With a little imagination, I think it’s easy to see why.

He talks about how, in this older situation, the web server becomes a sort of "simplified front controller+router+dispatcher" and the PHP page acts as a "controller". He suggests that, even though this structure isn't as well separated as an MVC application, it can still be organized to make it easier to maintain.

tagged: page controller mvc legacy structure

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

Aura.Web: Aura’s Page Controller for MVC
Jun 05, 2013 @ 09:58:42

On PHPMaster.com today Hari K T has spotlighted one of the components from the Aura framework, the Aura.Web component.

MVC is an acronym that means Model-View-Controller. In this tutorial I would like to introduce you to Aura.Web, the controller component of the Aura Library. Here I’ll show you how to use it to build your own controller, and also how to use a response transfer object to issue HTTP response headers, and integrate a templating engine like Mustache for rendering views.

He starts off with an overview of how the component is architected and how it is used to create controllers and what dependencies it needs injected. He talks about some of the objects and the methods they provide and includes some sample code for a basic "Index" controller. He shows how to integrate the Mustache templating engine for output and how to work directly with HTTP responses.

tagged: auraweb aura framework page controller mvc tutorial introduction

Link: http://phpmaster.com/aura-web-auras-page-controller-for-mvc