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

Rob Allen:
The beginner's guide to rebasing your PR
Oct 09, 2015 @ 10:30:12

If you've ever contributed to an Open Source project on GitHub (or really even just used Git in general) chances are there's been a time when you needed to rebase your branch with what's on master. It can be a bit confusing to Rob Allen is here to help with this brief guide to walk you through the steps for a successful rebase.

You've successfully created a PR and it's in the queue to be merged. A maintainer looks at the code and asks you to rebase your PR so that they can merge it. Say what?

The maintainer means that there have been other code changes on the project since you branched which means that your branch cannot be merged without conflicts and they would like to you to sort this out. These are the steps you should take.

He breaks it down into three main steps and includes the commands you'll need and how to push the result back up into the waiting repository:

  • Update your target branch from upstream
  • Rebase your branch
  • Push your newly rebased branch to origin

There's really about six steps involved but that's only when you break it down to the individual commands. It's a relatively simple process that, while a bit confusing from the outside, can be very helpful to a project maintainer when it comes merge time.

tagged: rebase pullrequest project opensource process tutorial contribute

Link: http://akrabat.com/the-beginners-guide-to-rebasing-your-pr/

Rob Allen:
The beginner's guide to contributing to a GitHub project
Sep 24, 2015 @ 12:08:10

If you've ever wanted to contribute to an open source project but didn't have any idea where to begin, Rob Allen has a few suggestions to help you get started. His guide is a bit more on the technical level than others that talk more about finding a project or community to be a part of, though.

This is a guide to contributing to an open source project that uses GitHub. It's mostly based on how I've seen Zend Framework, Slim Framework and joind.in operate. However, this is a general guide so check your project's README for specifics.

He walks you through a four step process to getting ready to contribute and make that first submission to the project of your choice:

  • Set up a working copy on your computer
  • Do some work
  • Create the PR (Pull Request)
  • Review by the maintainers

Naturally, some of this depends on the process that the project follows to take in new submissions, either from an issues list or just random buxfixes. It's a pretty standard GitHub-centric guide to follow though. He also recommends reading this article from Lorna Mitchell about code reviews and what the maintainers of most open source projects will look for in submissions.

tagged: beginner guide opensource github contribute project

Link: http://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

Laravel News:
Laravel Spark
Sep 16, 2015 @ 10:17:32

On the Laravel News site Eric Barnes has posted a guide to installing and configuring the alpha version of Spark, the latest offering from the Laravel ecosystem for building out a unified SaaS billing system.

The Alpha of Laravel Spark has just been released and it’s goal is to be an opinionated way of building out business oriented SaaS applications. It features team management, user roles, recurring billing through Stripe, and much more. In this tutorial let’s take a deeper look at this new package.

He gets right into the installation of the tool as a Composer package to pull in the spark installer command line tool. A quick spark install command is all it takes to create the new application. He then gets into the different things that you can do with the generated application including:

  • Customize Registration and Profile Updates
  • Customize Roles
  • Customize Settings Tabs
  • Building Spark Subscription Payment Plans
  • Create Coupons and Discounts

This is just a preview of what's offered in the package and what's to come in the final product, but it gives you a good idea of where it starts.

tagged: laravel spark saas billing project alpha release

Link: https://laravel-news.com/2015/09/laravel-spark/

SitePoint PHP Blog:
Using Sphinx for PHP Project Documentation
Aug 17, 2015 @ 09:19:04

The SitePoint PHP blog has posted a guide to using Sphinx, a documentation generation tool that's used behind the scenes for the ReadTheDocs hosted documentation service.

I recently had the need to write proper prose-like source-code documentation for the Diffbot PHP client. Having looked at several documentation generators, and even having suggested a @prose tag for importing of related MD/reST documents into method and class descriptions, I realized there simply is no perfect solution we can all agree on (yet). So until I extend Sage with a @prose token and reST parsing, I opted for ReadTheDocs and Sphinx.

He starts with a quick "TL;DR" of the necessary commands to get things working quickly but follows it with the full details. He walks you through the installation of Sphinx locally, setting up the folders and adding a custom theme. He show how to create the table of contents, activate the PHP syntax highlighting and how to show/hide the "Edit on GitHub" links. He also includes the steps to convert Markdown documents into the reST format and, finally, adding the project to the ReadTheDocs site and pushing your results.

tagged: sphinx project documentation tutorial readthedocs markdown rest

Link: http://www.sitepoint.com/using-sphinx-for-php-project-documentation/

MyBuilder Tech Blog:
Managing Jenkins Project Builds and Configuration using PHP
Jul 08, 2015 @ 09:57:22

The MyBuilder.com Tech blog has posted a tutorial showing you how to manage your Jenkins builds and configuration using PHP via the Jenkins REST API interface and a few handy curl calls.

I decided to create a simple PHP console script that can be run (or added as a git-hook) to maintain synchronization between the branch you are working on and the branch Jenkins is building. Whilst developing this script, it dawned on me that many other automated use-cases could be achieved with the ability to easily update a projects configuration file. [...] Jenkins fortunately provides us with a RESTful interface to manage typical tasks and activities. Included in this is the ability to read the XML configuration file for a specified project.

The tutorial includes examples of requests you can make to the API to do things like:

  • Reading the Projects Configuration
  • Writing to the Projects Configuration
  • Sending a Project Build Request

The post ends with the full script, a procedural process that executes each of the above steps in order (with an interesting use of the "goto" functionality).

tagged: manage jenkins build project configuration rest api tutorial curl

Link: http://tech.mybuilder.com/managing-jenkins-project-builds-and-configuration-using-php/

Joe Ferguson:
How I use Laravel Homestead everyday
Jun 25, 2015 @ 09:21:28

Joe Ferguson has a new post to his site sharing a bit about how he uses Homestead (the Laravel project's virtual machine offering) in his every day development.

I feel like I’ve been talking about homestead a lot lately. I feel like Vagrant is such an important part of a developer’s workflow. If you are still using MAMP, WAMP, or installing Virtual Machines manually you are wasting so much of your own time (and your clients money) by not using prebuilt development environments. [...] I prefer to have my open source projects contain a Vagrant environment so that any potential contributor can easily clone my repository and run “vagrant up”. [...] The recent changes to Homestead have brought the option to use Homestead exactly as I do, without having to use my own packages or copy and paste files.

He walks you through the simple process of getting a project set up with this Homestead-per-project configuration:

  • Starting a new Project
  • Adding Homestead as a dependency
  • Make the Homestead configuration for this project

Now when a "vagrant up" is run from the project, Vagrant understands to create a Homestead virtual machine instance, import the base box and configure it to be a locally hosted web server for your application. He also includes instructions for using it with non-Laravel applications and how to share the environment.

tagged: laravel homestead everyday tutorial project dependency vagrant

Link: http://www.joeferguson.me/how-i-use-laravel-homestead-everyday/

Joe Ferguson:
Install Homestead into your project
Jun 24, 2015 @ 09:53:42

As the Laravel News site mentions in one of their latest posts, the Laravel Homestead project received an update recently that makes it easier to install per-project rather than the previous "one install for everything" setup.

Over the weekend, Homestead received a new update that allows you to run it on a per project basis. Previously Homestead was designed so that you install it once on your system and share all your sites within the virtual machine. Joe Ferguson created the pull request to help get this feature implemented and he has a full write up on his blog.

This change pulls in the functionality doing all the hard work for you. It copies over needed files and setting up the Homestead vagrant instance directly from inside the project. Joe also describes the command line options you can provide, defining a name and hostname for the new instance. You can find out more about it in the official documentation.

tagged: laravel homestead project perproject command hostname name

Link: http://www.joeferguson.me/install-homestead-into-your-project/

SitePoint PHP Blog:
Nette Framework: First Impressions
Jun 23, 2015 @ 09:41:33

The SitePoint PHP blog has a new article posted with some first impressions of the Nette framework, a larger but not often talked about PHP framework that showed up in their framework survey results in third place.

SitePoint’s PHP channel conducted its annual survey on the most popular framework of 2015 and the results were discussed here. We saw some familiar names: Laravel, Symfony2, Phalcon, Silex, Slim, etc. But wait, what is this: Nette? According to the survey result, it ranked number 3 in both “at Work” and “in Personal Projects”, just tailing the two giants: Laravel and Symfony2.

I had never heard of this framework before the survey results got published. A framework so popular is worth looking into. Thus, in this article, we will take a look at Nette, see what it can do and discuss some of the features.

The Nette framework is a "set of decoupled and reusable PHP components" that combine into a complete framework (including templating, error tracing and unit testing integration). He follows along with their Getting Started guide and helps you get a demo application copy up and running (via Composer). He then goes through the project structure, the "Adminer" tool, route handling, controllers/actions and the "Latte" templating engine. He also covers basic security functionality and some other interesting features like the "Tracy" debugger and the use of the integrated unit test functionality.

tagged: nette framework first impression overview demo project tutorial

Link: http://www.sitepoint.com/nette-framework-first-impressions/

Build an API with Lumen and Fractal
Jun 17, 2015 @ 10:16:58

On the Laravelista.com site there's a recent tutorial posted showing you how to create an API with Lumen and Fractal, a combination of the popular Laravel-based microframework and Fractal, an output handling library that makes it simpler to transform data to your needs. This is the second part of his series (part one is here), making some improvements on his previous examples.

In the previous post I used Larasponse to get Fractal working with Laravel, but recently I have switched to native Fractal package. One thing to notice is that in this post I will be showing you parts of code from a real project that I am working on called Treeline, instead of just example code like in the previous post. Be sure to check the Treeline repository if you're unclear on something.

He goes back through some of the setup process, getting Fractal installed via Composer and the creation of an ApiController to handle basic things like setting the status code and transforming the response to JSON. He shows how to add in the necessary routes for the "projects" path and creates the matching controller, collection and item classes that integrate the Fractal transformers to format their output as JSON. He also includes the code for the transformer classes themselves, showing you how to pull in and modify the data for the API's needs. He ends the post showing how to integrate other data (the "notes" into a "project" instance) and the resulting JSON output.

tagged: lumen fractal api tutorial series part2 transform project note

Link: http://laravelista.com/build-an-api-with-lumen-and-fractal/

Loïc Chardonne:
Symfony Differently - part 2: Bootstrap
Jun 16, 2015 @ 10:46:03

Loïc Chardonne has posted the latest part in his "Symfony Differently" series (part one is here) with a focus on bootstrapping the application and configuring the environment that it will live in.

Our goal in this post is to bootstrap an application to then create a search endpoint for items. We've decided to use Symfony for a single reason: our company Acme used it since the beginning and the API developers team has Symfony and PHP skills.

He walks through the steps you'll need to get the application up and running:

  • Creating a new Symfony Standard Edition project
  • Configuring Apache
  • Moving the tests to a different directory, including Composer updates
  • Creating scripts for builds, testing and deployment

With all this structure in place, the next part of the series will start in on the functionality of the search endpoint and returning the results.

tagged: symfony bootstrap differently tutorial series part2 project apache scripts tests

Link: http://gnugat.github.io/2015/06/10/sf-differently-part-2-bootstrap.html