Slide 1

Slide 1 text

@phpdublin Who am I? Ken Guest https://about.me/kenguest Twitter @kenguest Web Developer at the Irish Times PEAR guy Services_OpenStreetMap 15 years of developing projects in PHP.

Slide 2

Slide 2 text

And what is Phing? PHing Is Not Gnu make https://www.phing.info/ A cross platform build tool written in PHP. Automation. Gear yourself for efficiency. DRY v WET. @phpdublin

Slide 3

Slide 3 text

And what can Phing do? Lint your code (php, javascript, xml) Run unit tests: phpunit, simpletest, behat Codesniffer Copy and Mess detectors Optimise images Minify javascript/css Transfer files (rsync, ftp, scp) Database migrations (dbdeploy, pdosqlexec) Modify ini files natively Git, SVN tasks Etc And it's in PHP? Yes. You can create custom tasks. @phpdublin

Slide 4

Slide 4 text

What projects use it? joind.in OpenDAM (Digital Asset Management - https://github.com/martin-wikipixel/openDAM) Semantic Scuttle (social bookmarking) And many others https://github.com/reload/phing-drupal-template How to use it? From phpStorm, TextMate or NetBeans 8.1 From command line From Continuous Integration: Jenkins, Travis etc @phpdublin

Slide 5

Slide 5 text

@phpdublin

Slide 6

Slide 6 text

@phpdublin

Slide 7

Slide 7 text

@phpdublin

Slide 8

Slide 8 text

Obligatory Hello World example: Hello @phpdublin

Slide 9

Slide 9 text

@phpdublin Example with Dependencies: Banner Hello $ phing banner $ phing hello $ phing

Slide 10

Slide 10 text

@phpdublin Native Tasks Hello..? Hello

Slide 11

Slide 11 text

@phpdublin Something more meaty:

Slide 12

Slide 12 text

@phpdublin Native Tasks v 'Exec' Compared to Tonnes others: https://www.phing.info/docs/guide/trunk/

Slide 13

Slide 13 text

@phpdublin Adhoc Tasks filename = $filename; } function main() { $this->log("Createusers: " . $this->filename); $serialised = file_get_contents($this->filename); $users = unserialize($serialised); foreach($users as $userRow) { // Do something useful... $this->log(implode($output)); } } } ]]>

Slide 14

Slide 14 text

@phpdublin Custom Tasks Different to AdHoc in that they reside outside of XML file. tasks/inifile/IniFileSet.php tasks/inifile/IniFileTask.php tasks/inifile/IniFileConfig.php tasks/inifile/IniFileRemove.php tasks/NotifySendTask.php

Slide 15

Slide 15 text

@phpdublin Questions? https://joind.in/14690