Our aim it to pull PHP developers together to work using the same tools and the same way. We believe that ensuring that having some best-practice and basic principles in place will play a big part in both team and personal development.
Before doing anything else make yourself a cup of tea and read everythign on PHP The Right Way.
We want to work in an ecosystem that empowers developers to reach their potential--one that encourages growth and collaboration. A space that is safe for all. This is why we support The Code Manifesto.
And remember, most systems work best if they are kept simple rather than made complicated.
The key words "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED" and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
The below list is a quick list of the Clicksco PHP team. Clicking on a name will take you to the official Tech Team Who's Who page on the Clickso company wiki.
|Viacheslav Epifanov (aka Slava)||ClicksControl||Russia|
|Philippe Jausions||CPA / ECommerce / Click.net||France|
|Andrew Nicholson||CPA / ECommerce||UK|
|Dmitrii Shumkov (aka Dima)||ClicksControl||Russia|
|Rick Trotter||Clicksco Labs||UK|
|Alexander Trunov (aka Sasha)||ClicksControl||Russia|
|Usman Zafar||CPA / ECommerce||Dubai|
Communication and collaboration are key! Don't be a hermit, talk to each other!
All projects must use version control. At Clicksco we use Git.
The workflow of choice for the PHP team at Clicksco is Github Flow.
Github Flow is a way of working with Git that focusses on collaboration and quick releases and has been demonstrated to grow well with large teams.
The only hard rule of the system, and the main thing to remember, is that anything on the
master branch is deployable. This means that it should never be broken or partially complete.
Let's look at each in a little more detail...
Everything comes from
master, it's stable, safe and a representation of the current live system.
Branches should be based on a description of the new feature or work that you're doing. It makes things easy to read at a glance and, for larger teams, makes it clear as to what everyone is/has been working on.
Some examples might be:
Once created, push your new branch to the remote.
Do what you do, my friend. Squash bugs, add features, make the world better one line of code at a time.
Commit to your branch locally and regularly push to your remote copy.
Once you feel like the branch is ready for deployment, open a pull request on the remote. Where applicable, tag someone in it, possibly a developer responsible for reviewing and signing off the feature.
Review the code, go back and make changes if you need to. Any further pushes to the remote branch will update the pull request/sup>. (If you need a fix that has since been merged into
master, you can always merge it into your feature branch.)
Peer review and/or sign-off isn't always required. If it's a rapid fix, or you're working on your own, just up and merge it yourself. That's not to say that you won't want to run something past someone; and merge requests are a great way to do that!
When satisfied, complete the merge to
What? You thought you were finished? GOTO 10.
A standard .gitignore example is shown below. Please make sure to ignore all editor/IDE settings etc.
.idea vendor .DS_Store .vagrant
All projects at Clicksco have a Basecamp project assigned to them. Basecamp is a great way to communicate with project leads, project managers and other developers about top-level discussions. It's the prefered method of communication.
It's good practice to manage a top level to-do list in Basecamp which is understandable and readable by everyone. You can then reference which ticket this work refrences in Codebase by adding [Ticket 44] to the title.
The Clicksco PHP team has access to our company Codebase account. Codebase is a great place for more technical discussions within your project team. The ticketing system must be used to manage all feature requests, bugs, enhancements etc. Each project that is managed by Codebase will have it's own repository which should be kept up to date.
Codebase repositories will have an automatic secondary backup to a repository on the company BitBucket account. This is managed in the settings in Codebase.
When you make a commit you can reference tickets in your commit and when it is pushed to Codebase it will automatically update ticket status etc. Read more about this.
Updating Your Ticket
[touch: ticketnumber] e.g. [touch: 10]
Changing the Status
[statusname: ticketnumber] e.g. [completed: 10]
For every new project a short team discussion will take place to make sure the right Framework will be implemented. The default/standard framework is currently Laravel.
As a team we understand that each project is different with different requirements which may not fit in with the standard framework of choice. We also understand that as a large team of developers as part of a international company it is sensible to have a certain about of standardisation when it comes to tools and processes. Because of this we discuss each projects requirements together before a new project is started to make sure the correct tools are used. We are open to assessing new frameworks and have an internal process for this.
A developer is open to use whichever editor they want. Every developer has access to a PHP Storm licence if they want and this is the more widely used IDE within the group.
As we don't believe in wasting time reinventing the wheel, the Clickco PHP team follow the great work by the PHP Framework Interop Group (PHP-FIG) and follow the various PSR's (PHP Standards Recommendation). A great article explaining what this is all about can be read here PSR-Huh?.
There are a number of tools to help you stick to our chosen coding standard (coding style). One of those tools is called PHP_CodeSniffer, which validates your code for consistence with PSR. You can use this tool via the command line or set PHPStorm to use this to highlight errors in the IDE as you type. Setting up PHPStorm and PHP_CodeSniffer, checkout this quick video.
Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
Every project should make use of Composer and this is the standard way of setting up autoloading in projects.
You should always do a search on Packagist and also our company package directory before you work on a new package. Before writing new functionality for your project take a step back and discuss with the team if what you are working on should be a package so we can all make use of it.
When creating a package we have a set of standard README etc. templates which include some required and some optional sections. This is hosted in a repository on the company BitBucket account.
We have a number of packages that are located on our internal Composer Repository which is powered by Satis.
It's always worth checking out the packages that are available on The League of Extraordinary Packages.
Below we have listed a few of our favourite packages that we uses across our projects.
|Name / Summary||Tags|
Database Backup Manager
Supports MySQL and PostgreSQL, compress with Gzip, framework-agnostic, dead simple configuration, optional integrations for MVC framework Laravel
|laravel, databaase, backup, mysql, postgresql|
Inverse seed generator (iSeed)
Laravel 4 package that provides a method to generate a new seed file based on data from the existing database table.
|laravel, seed, generator|
Faker is a PHP library that generates fake data for you
|laravel, data, seed|
Generators by Jeffrey Way
Fast Workflow in Laravel With Custom Generators.
|laravel, seed, generators|
UUID for PHP
Rhumsaa\Uuid is a PHP 5.3+ library for generating and working with RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).
|uuid, unique, identifier|
API for Laravel
This is an API package for the Laravel framework. It allows you to build a flexible RESTful API that can be consumed externally and by your own application.
PHP OAuth 2.0 Server for Laravel
A wrapper package for the standards compliant OAuth 2.0 authorization server and resource server written in PHP by the League of Extraordinary Packages.
Dispatcher allows you to schedule your artisan commands within your Laravel project, eliminating the need to touch the crontab when deploying.
|laravel, cron, schedule, commands|
We are working on a base box to match the companies live environments. A temporary setup can be found on our GitHub page. Another great resource is puphpet.com, a simple GUI to set up virtual machines for PHP development.
Continuous Integration is managed using Codeship. This is a great service which runs tests and deployments. This is our prefered method of deployment.
Our prodcution bug tracking is managed by Bugsnag. Once a bug is detected the appropriate HipChat project room will be notified and a bug ticket will automatically be created in Codebase for that project.
Every project should include DocBlocks. What is a docblock?
A few useful links can be found below:
Copyright 2014 Clicksco. All rights reserved.