Slide 1

Slide 1 text

AGILE TOOLBOX FOR A PHP DEVELOPER Sat, 6 Dec 2014 - Hackatron Asia 2014 1

Slide 2

Slide 2 text

SLIDES http://j.mp/phpagiletoolbox 2

Slide 3

Slide 3 text

MICHAEL CHENG Engineer, Neo Innovation Pte Ltd http://twitter.com/coderkungfu http://github.com/miccheng http://CoderKungfu.com 3

Slide 4

Slide 4 text

AGILE DEVELOPER • Software Craftsmen. • Individuals and interactions over processes and tools • Working software over comprehensive documentation • Customer collaboration over contract negotiation • Responding to change over following a plan Source: http://agilemanifesto.org 4

Slide 5

Slide 5 text

AGILE DEVELOPER • Communicative and collaborative. • Discussions around stories. • Test Driven & Behaviour Driven. • Tests contains the documentation. • Responsive to change. • Not waiting till the end of the dev lifecycle to fix a bug. 5

Slide 6

Slide 6 text

THE TOOLBOX • Not all of them are written in PHP. • Best tool for the task. • DevOps tools - automate tedious tasks. 6

Slide 7

Slide 7 text

WRITING TOOLS • Use an IDE • VIM (https://code.google.com/p/macvim/) • PHPStorm (http://www.jetbrains.com/phpstorm) • Netbeans for PHP (https://netbeans.org/features/php/) • Atom (https://atom.io) 7

Slide 8

Slide 8 text

WRITING TOOLS • RTFM • PHP website (http://php.net) • Dash (http://kapeli.com/dash) 8

Slide 9

Slide 9 text

COLLABORATION TOOLS • Version Control System • Git (http://git-scm.com/) • SourceTree (http://www.sourcetreeapp.com) • GitHub / BitBucket (Git repo hosting) • Gitlab (in-house) 9

Slide 10

Slide 10 text

COLLABORATION TOOLS • Ways of using Git • Git Flow • Forking workflow • https://www.atlassian.com/git/tutorials/ comparing-workflows 10

Slide 11

Slide 11 text

PRODUCTIVITY TOOLS • Use a PHP framework that supports testing • Laravel 4 (http://laravel.com/) • CakePHP (http://cakephp.org/) 11

Slide 12

Slide 12 text

PRODUCTIVITY TOOLS • Check code dependencies. • Composer (https://getcomposer.org/) • NPM, Browserify, Bower • Bundler (http://bundler.io) 12

Slide 13

Slide 13 text

COMPOSER • Pick and choose libraries you want to put together on Packagist (https://packagist.org/). • Compose your own composer.json. • Choose a package namespace for your own project. • Reference: https://getcomposer.org/ 13

Slide 14

Slide 14 text

COMPOSER.JSON { "require":{ "respect/rest": "0.5.0", "monolog/monolog": "1.7.0", "php-activerecord/php-activerecord": "v1.1.2" }, "require-dev": { "phpunit/phpunit": "4.0.*", "guzzle/guzzle": "v3.8.1" } } 14

Slide 15

Slide 15 text

INSTALL LIBRARIES $ composer install Loading composer repositories with package information Installing dependencies (including require-dev) - Installing respect/rest (0.5.0) Downloading: 100% - Installing psr/log (1.0.0) Downloading: 100% - Installing monolog/monolog (1.7.0) Downloading: 100% - Installing php-activerecord/php-activerecord (v1.1.2) Downloading: 100% 15

Slide 16

Slide 16 text

PRODUCTIVITY TOOLS • Quick PHP server • Build in web server (php -S localhost:8000) • PHPUp (https://github.com/lox/phpup) 16

Slide 17

Slide 17 text

PHP BUILD IN WEB SERVER $ php -S 0.0.0.0:8000 PHP 5.5.12 Development Server started at Sat May 3 14:34:44 2014 Listening on http://0.0.0.0:8000 Document root is /Users/miccheng/Dropbox/workspace/plain Press Ctrl-C to quit. [Sat May 3 14:34:47 2014] 127.0.0.1:50368 [200]: / [Sat May 3 14:34:47 2014] 127.0.0.1:50370 [404]: / favicon.ico - No such file or directory 17

Slide 18

Slide 18 text

PRODUCTIVITY TOOLS • Use a Virtual Environment for development: • Vagrant (http://vagrantup.com) • Tool for building complete development environments. • PuPHPet (https://puphpet.com/) • Configuration for a Vagrant VM. 18

Slide 19

Slide 19 text

PRODUCTIVITY TOOLS • Terminal Tools • iTerm 2 (http://iterm2.com) • Tmux (Terminal muxing) / Tmate (remote access) • Window Manager (quick screen resizing) • Size Up / Spectacle / Moom • Autojump (https://github.com/joelthelion/autojump) 19

Slide 20

Slide 20 text

TESTING TOOLS • Use a Testing Framework • PHPUnit (http://phpunit.de/) • Codeception (http://codeception.com/) 20

Slide 21

Slide 21 text

TESTING TOOLS • Debugging tools • Xdebug (http://xdebug.org/) • WebGrind (https://github.com/jokkedk/ webgrind) • PHPDBG (http://phpdbg.com/) • > PHP 5.4.* (build in for PHP 5.6) 21

Slide 22

Slide 22 text

TESTING TOOLS • Automation Testing • Selenium (http://www.seleniumhq.org) • Saucelabs / Testdroid / Selendroid • Capybara (http://jnicklas.github.io/ capybara) • Modern.ie (http://modern.ie/en-us) 22

Slide 23

Slide 23 text

DEPLOYMENT TOOLS • Continuous Integration • Jenkins-CI (http://jenkins-ci.org) • Cruise Control (http:// cruisecontrol.sourceforge.net) • Travis-CI (http://travis-ci.org) 23

Slide 24

Slide 24 text

OTHER TOOLS • Online tools • Online JSON viewer (http:// jsonviewer.stack.hu/) • Nitrous.io (http://nitrous.io) • PivotalTracker (http://pivotaltracker.com) • Trello (https://trello.com) 24

Slide 25

Slide 25 text

MORE READINGS… • PHP The Right Way 
 (http://www.phptherightway.com/) • The PHP Framework Interop Group (PHP-FIG) (http://www.php-fig.org/) • Clean Code: A Handbook of Agile Software Craftsmanship (http://www.amazon.com/Clean-Code- Handbook-Software-Craftsmanship/dp/0132350882) 25

Slide 26

Slide 26 text

MORE READINGS… • Awesome PHP 
 (https://github.com/ziadoz/awesome-php) 26

Slide 27

Slide 27 text

QUESTIONS? 27