Core Development Instructions

Eric Hough edited this page Aug 8, 2013 · 3 revisions

This page will guide you through the process of setting up a simple development environment for TubePress's core.

Prerequisites:

  • Familiarity with Git
  • A GitHub account
  • PHP CLI 5.2+ installed
  • Composer installed
  • (Recommended) msgfmt installed

Step 1: Fork and clone the repository

  1. If you haven't already, click here to fork the TubePress public repository.
  2. Clone your forked repository to your local machine:
> git clone git@github.com:<yourusername>/tubepress.git

Cloning into 'tubepress'...
remote: Counting objects: 48432, done.
remote: Compressing objects: 100% (17261/17261), done.
remote: Total 48432 (delta 25257), reused 47853 (delta 24690)
Receiving objects: 100% (48432/48432), 15.62 MiB | 3.24 MiB/s, done.
Resolving deltas: 100% (25257/25257), done.
Checking connectivity... done

You should now have a local copy of the TubePress core repository.

Step 2: Setup your branches

TubePress's repository follows the git-flow model. Thus your work will always be on a feature branch from develop, and any pull requests must always be made to the develop branch.

  1. Create your new branch:
> git branch myfeature develop
  1. Checkout your new branch:
> git checkout myfeature

Switched to branch 'myfeature'

Step 3: Install dependencies with Composer

TubePress uses Composer heavily to manage dependencies. Installation of those dependencies is simple:

> composer update --dev

Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing ...
...
Writing lock file
Generating autoload files

Step 4: Run and Verify Tests

TubePress uses PHPUnit for unit tests. You can run these tests from the command line:

> php vendor/phpunit/phpunit/phpunit.php -c src/test/resources/phpunit.xml

PHPUnit 3.7.23 by Sebastian Bergmann.

Configuration read from /home/ehough/Desktop/tubepress/src/test/resources/phpunit.xml

...............................................................  63 / 674 (  9%)
............................................................... 126 / 674 ( 18%)
............................................................... 189 / 674 ( 28%)
............................................................... 252 / 674 ( 37%)
............................................................... 315 / 674 ( 46%)
............................................................... 378 / 674 ( 56%)
............................................................... 441 / 674 ( 65%)
............................................................... 504 / 674 ( 74%)
............................................................... 567 / 674 ( 84%)
............................................................... 630 / 674 ( 93%)
............................................

Time: 4.68 seconds, Memory: 307.75Mb

OK (674 tests, 2129 assertions)

Step 5: Develop your code

(more info on this is coming soon!)

Step 6: Submit pull request

When you are ready to have your code reviewed for inclusion into the core, please submit a pull request to the develop branch.