2015年5月13日星期三

Community News: Recent posts from PHP Quickfix

Recent posts from the PHP Quickfix site:

Full Stack Radio: 17: Adam Culp - Maximizing Your Conference Experience


The Full Stack Radio podcast has posted their latest episode today, episode #17, hosted by Adam Wathan and featuring guest Adam Culp. Adam and Adam talk about ways you can maximize your conference experience.



n this episode, Adam talks to Adam Culp, organizer of Sunshine PHP and ZendCon. They talk about how to get into conference speaking, how to make the most of a conference as an attendee, as well as tips for running a great local user group.


You can listen to this latest episode either through the in-page audio player or by downloading the mp3 for the show. If you enjoy it, be sure to subscribe to their feed for more great episodes as they're released.


Link: http://fullstackradio.com/episodes/17/

SitePoint PHP Blog: Getting Started with eZ Platform on Vagrant


The SitePoint PHP blog has a new post about getting eZ platform set up and running on a Vagrant VM relatively painlessly. eZ Publish (and the newer eZ Platform) are a content management system aimed at the digital marketing space.



Last year, I had a somewhat negative experience with installing eZ Publish on a Vagrant box. Since then, they've significantly improved both the software and the VM-friendliness by, well, flat out removing the legacy stack. The VM setup we'll be using in this tutorial comes from the labs of NetGen and the mind of @vranac, and is followed by the installation procedure on our very own Homestead Improved modified by yours truly.


Author Bruno Skvorc walks you through the entire process, using Vranac (Vagrant, Anisble and VirtualBox) to get the VM instance set up and running. He then shows how to clone the latest eZ installation and build the demo application. He follows this with the instructions on getting the same setup running on a Homestead Improved instance, requiring a few more steps but it can be a bit faster overall. He finishes off the post by mentioning an upcoming event, PHPSummerCamp, a conference that will include sessions and in-depth looks at the eZ Publish and Platform functionality (happening in Croatia in August).


Link: http://www.sitepoint.com/getting-started-ez-platform-vagrant/

DigitalOcean Community Blog: How To Deploy a Basic PHP Application using Ansible on Ubuntu 14.04


If you've ever been interested in learning Ansible and how to use it in deploying your PHP applications, you should check out this new tutorial from Stephen Rees-Carter on the DigitalOcean blog. He walks you through the full process for getting the server and application set up and configured just the way you need it (on a Ubuntu server).



This tutorial covers the process of provisioning a basic PHP application using Ansible. The goal at the end of this tutorial is to have your new web server serving a basic PHP application without a single SSH connection or manual command run on the target Droplet. We will be using the Laravel framework as an example PHP application, but these instructions can be easily modified to support other frameworks and applications if you already have your own.


He starts with a list of the things you'll already need installed and things to know including a basic understanding of Ansible and two servers (they use their own Droplets in the examples). From there, they walk you through a seven step process to get the automated deployment up and running:



  • Installing Ansible
  • Installing Required Packages
  • Modifying System Configuration Files
  • Cloning the Git Repository
  • Creating an Application with Composer
  • Updating Environment Variables
  • Configuring Nginx


Some of the steps here are Laravel-specific as mentioned but if you're familiar with the setup of your own application, it's pretty easy to adapt. Each step includes the configuration changes and commands you'll need to complete it.


Link: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-basic-php-application-using-ansible-on-ubuntu-14-04

Sahand Saba: 9 Anti-Patterns Every Programmer Should Be Aware Of


In a recent post to his site Sahand Saba has posted a list of nine anti-patterns every programmer should avoid. This list isn't language specific and ranges in types of advice from general programming practices down to more specific "code smells" to avoid. The code examples are in Python but you can interpolate them into the world of PHP pretty easily.



A healthy dose of self-criticism is fundamental to professional and personal growth. When it comes to programming, this sense of self-criticism requires the ability to detect unproductive or counter-productive patterns in designs, code, processes, and behaviour. This is why a knowledge of anti-patterns is very useful for any programmer. This article is a discussion of anti-patterns that I have found to be recurring, ordered roughly based on how often I have come across them, and how long it took to undo the damage they caused.

The list of nine includes things like:



  • Premature Optimization
  • God Class
  • Inner-platform Effect
  • Management by Numbers


Each item on the list includes a few subheadings talking about what it is, why it's bad, how to avoid it and some code examples (where appropriate) to find it in your code.


Link: http://sahandsaba.com/nine-anti-patterns-every-programmer-should-be-aware-of-with-examples.html

NetTuts.com: Programming With Yii2: Sluggable Behavior


NetTuts.com has continued their series looking at programming with the Yii2 framework in this latest part of the series covering the "sluggable" behavior the framework includes.



In this Programming With Yii2 series, I'm guiding readers in use of the newly upgraded Yii2 Framework for PHP. In this tutorial, I'm going to show you how to modify Yii's default view URL routes for model objects to be more user friendly and search engine friendly. Yii provides built-in support for this via its sluggable behaviors. For these examples, we'll continue to imagine we're building a framework for posting simple status updates, e.g. our own mini-Twitter.


They start the tutorial off by defining what a "slug" is for those that may not have used them before. From there they show you how to add in the behavior to the current version of their sample application, adding a new "slug" column to their status table. They then update the status model to reflect the changes and test it out with the insert of a new update. They also show how to implement the slug handling in your routing and add the functionality to the controller to handle the different request. They finish off the post with a mention of managing permanence and uniqueness to prevent overlaps.


Link: http://code.tutsplus.com/tutorials/programming-with-yii2-sluggable-behavior--cms-23222

Voices of the ElePHPant: Interview with Anthony Ferrara


The Voices of the ElePHPant podcast has posted the latest in their series of interviews with members of the PHP community. In this new episode host Cal Evans talks with Anthony Ferrara.



Cal and Anthony talk some about security, some comments another speaker (Wim Godden) about password hashing and what PHP has to offer for those looking for functionality. They also discuss the work Anthony did on the password hashing API and how he helped to ensure forward compatibility. They talk some about Anthony's work at Google and how he represents their products.



You can listen to this latest episode either through the in-page audio player or by downloading the mp3. If you enjoy the interview and want to hear more, be sure to subscribe to their feed.


Link: https://voicesoftheelephpant.com/2015/05/12/interview-with-anthony-ferrara/