0
Who?Jeremy Coates, MD MagmaDigital Ltdjeremy@phpnw.org.uk@phpcodemonkey#phpnwlinkedin.com/in/jeremycoatesfacebook.com/jere...
PHPNW Manchester      UK5th year of eventTutorial Day - 5thOctoberConference - 6th& 7th October400 attendees, 3tracks, Unc...
ContentPhing Build System (basics)What is it / Why use itWhat can it doExample build files (+ live demo!)Phing & CI (Jenki...
Whats this Phing       about?                       The TPhingBuild system- Based    on Ant (Apache)- PHP(5)   based- No  ...
I dont need nostinking Build SystemDo you write PHP Apps or just web pages?-   Configuration-   Deployment-   Committing- ...
I dont need nostinking Build SystemDo you write PHP Apps or just web pages?-   Configuration                     - Prepara...
What can this Phing       do?Pretty well everything bar make tea!Anything a shell script can do (FTP, SCP,Chown, Touch, SS...
Oh is that all?
Oh is that all?Unit tests (phpunit, simpletest)Database deployment (dbdeploy/liquibase)Lint (PHP, JS, XML)Reporting (code ...
What Phings can I      use?
Hows it work?Phing shell script,launches Phing PHPApp + your XML buildfileBuild file contains:-   Properties-   Targets-  ...
Hello World!
Example build   script
phing clean
prepare
deploy staging
deploy live
Continuous       IntegrationRemove relianceon Human natureRegular automatedbuilds (phing/ant)Report on buildstatus
CI ReportsFor many of thetools were alreadyfamiliar withPhing targets:- phpcs,   pdepend,  phpcpd, phpmd,  phpunit, phpcb ...
Phing - contextPhing vs. Ant: Ant is inspiration forPhing. Phing doesnt need JVM & isLGPL (Ant: Apache v2)Phing 1: PHP4Phi...
Resourceshttp://www.phing.info   @phingofficialhttp://www.phing.info/docs/guide/stable/http://jenkins-ci.orghttp://phpqato...
Questions?
Feedback?Jeremy Coates, MDMagma Digital LtdPlease providefeedback:https://joind.in/6392
An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)
An introduction to Phing the PHP build system (PHPDay, May 2012)
Upcoming SlideShare
Loading in...5
×

An introduction to Phing the PHP build system (PHPDay, May 2012)

3,418

Published on

Talk given on 19th May 2012 at PHPDay 2012 conference in Verona, Italy.

An insight into the Phing build system for PHP, why and how you might use it along with where it sits with related tools such as PHPUnit, PHP Code Sniffer, PHP Mess Detector etc. We will also take a brief look at how Phing can integrate with Continuous Integration, taking Jenkins as our example. We will also be including some simple practical demos of Phing in action!

Published in: Technology
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,418
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
38
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide
  • \n\n
  • \n\n
  • \n\n
  • \n\n
  • Phing = PHing Is Not Gnu make\n\nDeveloper build toolkit - tool for every job (almost)!\nLGPL Licensed\n\nMy knowledge of Phing about 20%, however there's great documentation!\n
  • Web applications require deployment, packaging, testing, setting permissions, configuration, creating log files\nDoing so by hand every time is scary!\n
  • \n\n
  • \n\n
  • \n\n
  • Project: root XML node\nTargets: collection of tasks, together for a reason\nTasks: call to specific action e.g. copy, symlink etc.\n
  • \n\n
  • \n\n
  • Fileset selectors - powerful matching, as well as **\ndate based, size, file/dir, related files present\nMapper - also a good tool, convert filenames during build\nFilters (filterchains) - transform data during build, e.g. strip comments, replace values in config files (via regex)\n<php> task - evaluate PHP expression/Fn call result stored in property\nEmbed PHP direct in build file using <adhoc> task (Needs to be <adhoc><![CDATA[...]]></adhoc>\n
  • \n\n
  • \n\n
  • \n\n
  • \n\n
  • CI Tools watch for commits, then kick start the build process, in this case Phing\nAlternatives to Jenkins: CruiseControl (Phing builder), Xinc - PHP CI tool, uses Phing\n
  • \n\n
  • \n\n
  • \n\n
  • \n\n
  • \n\n
  • \n\n
  • Transcript of "An introduction to Phing the PHP build system (PHPDay, May 2012)"

    1. 1. Who?Jeremy Coates, MD MagmaDigital Ltdjeremy@phpnw.org.uk@phpcodemonkey#phpnwlinkedin.com/in/jeremycoatesfacebook.com/jeremycoates
    2. 2. PHPNW Manchester UK5th year of eventTutorial Day - 5thOctoberConference - 6th& 7th October400 attendees, 3tracks, Unconf,Hackathon
    3. 3. ContentPhing Build System (basics)What is it / Why use itWhat can it doExample build files (+ live demo!)Phing & CI (Jenkins)Questions
    4. 4. Whats this Phing about? The TPhingBuild system- Based on Ant (Apache)- PHP(5) based- No extra dependencies- Cross platform flickr.com/photos/
    5. 5. I dont need nostinking Build SystemDo you write PHP Apps or just web pages?- Configuration- Deployment- Committing- Testing- Documenting
    6. 6. I dont need nostinking Build SystemDo you write PHP Apps or just web pages?- Configuration - Preparation- Deployment - Predictability- Committing - Confidence- Testing- Documenting - Familiarity
    7. 7. What can this Phing do?Pretty well everything bar make tea!Anything a shell script can do (FTP, SCP,Chown, Touch, SSH etc.) for deploymentIntegrate with version control (CVS, SVN,Git)Code quality checks (phpcs, pdepend,phpmd etc.)
    8. 8. Oh is that all?
    9. 9. Oh is that all?Unit tests (phpunit, simpletest)Database deployment (dbdeploy/liquibase)Lint (PHP, JS, XML)Reporting (code coverage, PHPDoc,DocBLox)Not enough? Write your own Tasks or Exec
    10. 10. What Phings can I use?
    11. 11. Hows it work?Phing shell script,launches Phing PHPApp + your XML buildfileBuild file contains:- Properties- Targets- Tasks flickr.com/photos/jm3/4814208649
    12. 12. Hello World!
    13. 13. Example build script
    14. 14. phing clean
    15. 15. prepare
    16. 16. deploy staging
    17. 17. deploy live
    18. 18. Continuous IntegrationRemove relianceon Human natureRegular automatedbuilds (phing/ant)Report on buildstatus
    19. 19. CI ReportsFor many of thetools were alreadyfamiliar withPhing targets:- phpcs, pdepend, phpcpd, phpmd, phpunit, phpcb etc.
    20. 20. Phing - contextPhing vs. Ant: Ant is inspiration forPhing. Phing doesnt need JVM & isLGPL (Ant: Apache v2)Phing 1: PHP4Phing 2: PHP5.2+ phing version 2.4.12Michiel Rook: Project Lead @michieltcs
    21. 21. Resourceshttp://www.phing.info @phingofficialhttp://www.phing.info/docs/guide/stable/http://jenkins-ci.orghttp://phpqatools.orghttp://dbdeploy.com / http://liquibase.orghttp://ant.apache.org
    22. 22. Questions?
    23. 23. Feedback?Jeremy Coates, MDMagma Digital LtdPlease providefeedback:https://joind.in/6392
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×