Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Agile Toolbox for a PHP Developer

Agile Toolbox for a PHP Developer

Presented at the Philippines PHP User Group on 3 May 2014

Michael Cheng

May 03, 2014
Tweet

More Decks by Michael Cheng

Other Decks in Technology

Transcript

  1. AGILE TOOLBOX FOR A PHP DEVELOPER
    Philippines PHP User Group
    1

    View Slide

  2. SPEAKERDECK
    http://bit.ly/agiletoolbox-php
    2

    View Slide

  3. MICHAEL CHENG
    Engineer, Neo Innovations
    !
    http://twitter.com/coderkungfu
    http://github.com/miccheng

    http://CoderKungfu.com
    3

    View Slide

  4. 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

    View Slide

  5. 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

    View Slide

  6. THE TOOLBOX
    • Not all of them are written in PHP.

    • Best tool for the task.

    • DevOps tools - automate tedious tasks.
    6

    View Slide

  7. THE TOOLS
    • Version Control System

    • Git (http://git-scm.com/)

    • GitHub / BitBucket
    7

    View Slide

  8. THE TOOLS
    • Check code dependencies.

    • Composer (https://getcomposer.org/)
    8

    View Slide

  9. 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/
    9

    View Slide

  10. 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"!
    }!
    }
    10

    View Slide

  11. 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%
    11

    View Slide

  12. THE TOOLS
    • Quick PHP server

    • Build in web server (php -S localhost:8000)

    • PHPUp (https://github.com/lox/phpup)
    12

    View Slide

  13. 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
    13

    View Slide

  14. THE TOOLS
    • Use a Testing Framework

    • PHPUnit (http://phpunit.de/)

    • Codeception (http://codeception.com/)
    14

    View Slide

  15. THE TOOLS
    • Use a PHP framework that supports testing

    • Laravel 4 (http://laravel.com/)

    • CakePHP (http://cakephp.org/)
    15

    View Slide

  16. THE TOOLS
    • Offline documentation and quick search

    • Dash (http://kapeli.com/dash)
    16

    View Slide

  17. THE TOOLS
    • Use an IDE

    • PHPStorm (http://www.jetbrains.com/
    phpstorm)

    • Netbeans for PHP (https://netbeans.org/
    features/php/)
    17

    View Slide

  18. THE TOOLS
    • Use a Virtual Machine for development:

    • Vagrant (http://vagrantup.com)

    • Tool for building complete development
    environments.

    • PuPHPet (https://puphpet.com/)

    • Configuration for a Vagrant VM.
    18

    View Slide

  19. THE 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)
    19

    View Slide

  20. THE TOOLS
    • Online tools

    • Modern.ie (http://modern.ie/en-us)

    • Online JSON viewer (http://
    jsonviewer.stack.hu/)

    • Nitrous.io (http://nitrous.io)

    • PivotalTracker (http://pivotaltracker.com)
    20

    View Slide

  21. 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)
    21

    View Slide

  22. QUESTIONS?
    22

    View Slide