SlideShare a Scribd company logo
An introduction to Phing the PHP build system (PHPDay, May 2012)
Who?
Jeremy Coates, MD Magma
Digital Ltd

jeremy@phpnw.org.uk

@phpcodemonkey

#phpnw

linkedin.com/in/
jeremycoates

facebook.com/jeremycoates
PHPNW Manchester
      UK
5th year of event

Tutorial Day - 5th
October

Conference - 6th
& 7th October

400 attendees, 3
tracks, Unconf,
Hackathon
Content
Phing Build System (basics)

What is it / Why use it

What can it do

Example build files (+ live demo!)

Phing & CI (Jenkins)

Questions
What's this Phing
       about?
                       The TPhing
Build system

- Based    on Ant
 (Apache)

- PHP(5)   based

- No   extra
 dependencies

- Cross   platform
                     flickr.com/photos/
I don't need no
stinking 'Build System'
Do you write PHP Apps or just web pages?

-   Configuration

-   Deployment

-   Committing

-   Testing

-   Documenting
I don't need no
stinking 'Build System'
Do you write PHP Apps or just web pages?

-   Configuration
                     - Preparation
-   Deployment
                     - Predictability
-   Committing
                     - Confidence
-   Testing

-   Documenting
                     - Familiarity
What can this Phing
       do?
Pretty well everything bar make tea!

Anything a shell script can do (FTP, SCP,
Chown, Touch, SSH etc.) for deployment

Integrate with version control (CVS, SVN,
Git)

Code quality checks (phpcs, pdepend,
phpmd etc.)
Oh is that all?
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
What Phings can I
      use?
How's it work?
Phing shell script,
launches Phing PHP
App + your XML build
file

Build file contains:

-   Properties

-   Targets

-   Tasks              flickr.com/photos/jm3/4814208649
Hello World!
Example build
   script
An introduction to Phing the PHP build system (PHPDay, May 2012)
phing clean
prepare
deploy staging
deploy live
Continuous
       Integration
Remove reliance
on Human nature

Regular automated
builds (phing/ant)

Report on build
status
CI Reports

For many of the
tools we're already
familiar with

Phing targets:

- phpcs,   pdepend,
  phpcpd, phpmd,
  phpunit, phpcb etc.
An introduction to Phing the PHP build system (PHPDay, May 2012)
Phing - context

Phing vs. Ant: Ant is inspiration for
Phing. Phing doesn't need JVM & is
LGPL (Ant: Apache v2)

Phing 1: PHP4

Phing 2: PHP5.2+   phing version 2.4.12

Michiel Rook: Project Lead @michieltcs
Resources
http://www.phing.info   @phingofficial

http://www.phing.info/docs/guide/stable/

http://jenkins-ci.org

http://phpqatools.org

http://dbdeploy.com / http://liquibase.org

http://ant.apache.org
Questions?
Feedback?

Jeremy Coates, MD
Magma Digital Ltd

Please provide
feedback:

https://joind.in/6392

More Related Content

KEY
Phing
Jeremy Coates
 
PPT
PHPUnit Automated Unit Testing Framework
Dave Ross
 
PPTX
Webdevcon pierrejoye-php54-and-other
Pierre Joye
 
PPTX
Integração Contínua com PHPCI
Thiago Paes
 
PPTX
Php test fest
Barry O Sullivan
 
PDF
Enterprise PHP
Mohammad Emran Hasan
 
ODP
Lighning Talk: PHP build process
Bryan Agee
 
PDF
Becoming A Php Ninja
Mohammad Emran Hasan
 
PHPUnit Automated Unit Testing Framework
Dave Ross
 
Webdevcon pierrejoye-php54-and-other
Pierre Joye
 
Integração Contínua com PHPCI
Thiago Paes
 
Php test fest
Barry O Sullivan
 
Enterprise PHP
Mohammad Emran Hasan
 
Lighning Talk: PHP build process
Bryan Agee
 
Becoming A Php Ninja
Mohammad Emran Hasan
 

What's hot (20)

PDF
PHP Files: An Introduction
Jacques Woodcock
 
PDF
Organizing Your PHP Projects (2010 ConFoo)
Paul Jones
 
PPT
Tech talk: PHP
Jen Wei Lee
 
PDF
Using Composer to create manageable WordPress websites
Anna Ladoshkina
 
PPTX
Python for web development
Luis Borbon
 
ODP
Elixir koans
Ruben Amortegui
 
PDF
Best practices-for-production-environments
Artem Kovardin
 
PDF
How to manage an open source project
Juanjo Bazán
 
PPTX
Frontend testing with Codeception
Christian Keuerleber
 
ZIP
镐京入场培训.Key
Bean Tsang
 
PPTX
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
jazoon13
 
PDF
Surgeons guide plugin development
afragen
 
PDF
Groovy and noteworthy
Izzet Mustafaiev
 
PPTX
Golang
Michael Blake
 
PPTX
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
John Potocny
 
PPT
FTC Robot C to Java
Jeanne Boyarsky
 
PDF
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Alexander Lisachenko
 
PDF
Browser controller testing for webapps (in Windows environment)
Adrian Spinei
 
ODP
PHP e Open Source
Er Galvão Abbott
 
PPTX
Web to App:作業系統革命 Firefox OS
Veck Hsiao
 
PHP Files: An Introduction
Jacques Woodcock
 
Organizing Your PHP Projects (2010 ConFoo)
Paul Jones
 
Tech talk: PHP
Jen Wei Lee
 
Using Composer to create manageable WordPress websites
Anna Ladoshkina
 
Python for web development
Luis Borbon
 
Elixir koans
Ruben Amortegui
 
Best practices-for-production-environments
Artem Kovardin
 
How to manage an open source project
Juanjo Bazán
 
Frontend testing with Codeception
Christian Keuerleber
 
镐京入场培训.Key
Bean Tsang
 
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
jazoon13
 
Surgeons guide plugin development
afragen
 
Groovy and noteworthy
Izzet Mustafaiev
 
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
John Potocny
 
FTC Robot C to Java
Jeanne Boyarsky
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Alexander Lisachenko
 
Browser controller testing for webapps (in Windows environment)
Adrian Spinei
 
PHP e Open Source
Er Galvão Abbott
 
Web to App:作業系統革命 Firefox OS
Veck Hsiao
 
Ad

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

KEY
An introduction to Phing the PHP build system
Jeremy Coates
 
PDF
Building and deploying PHP applications with Phing
Michiel Rook
 
PDF
Putting Phing to Work for You
hozn
 
PPTX
Automation with phing
Joey Rivera
 
KEY
Automating Web Application Deployment
Mathew Byrne
 
PDF
Deploying PHP applications with Phing
Michiel Rook
 
PDF
Phing: Building with PHP
hozn
 
PDF
Building and Deploying PHP apps with Phing
Michiel Rook
 
PPT
Build Automation of PHP Applications
Pavan Kumar N
 
PDF
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
PDF
Phing
Vladimir Melnic
 
PDF
2013 10-28 php ug presentation - ci using phing and hudson
Shreeniwas Iyer
 
KEY
Write php deploy everywhere
Michelangelo van Dam
 
KEY
Continuous Integration Step-by-step
Michelangelo van Dam
 
PDF
Automation using-phing
Rajat Pandit
 
PDF
Improving qa on php projects
Michelangelo van Dam
 
ODP
PHP Quality Assurance Workshop PHPBenelux
Nick Belhomme
 
PPTX
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Max Romanovsky
 
PPTX
Symfony Under Control by Maxim Romanovsky
php-user-group-minsk
 
PPTX
Introduction To Web Development & The New Digital Workplace
Jen Wei Lee
 
An introduction to Phing the PHP build system
Jeremy Coates
 
Building and deploying PHP applications with Phing
Michiel Rook
 
Putting Phing to Work for You
hozn
 
Automation with phing
Joey Rivera
 
Automating Web Application Deployment
Mathew Byrne
 
Deploying PHP applications with Phing
Michiel Rook
 
Phing: Building with PHP
hozn
 
Building and Deploying PHP apps with Phing
Michiel Rook
 
Build Automation of PHP Applications
Pavan Kumar N
 
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
2013 10-28 php ug presentation - ci using phing and hudson
Shreeniwas Iyer
 
Write php deploy everywhere
Michelangelo van Dam
 
Continuous Integration Step-by-step
Michelangelo van Dam
 
Automation using-phing
Rajat Pandit
 
Improving qa on php projects
Michelangelo van Dam
 
PHP Quality Assurance Workshop PHPBenelux
Nick Belhomme
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Max Romanovsky
 
Symfony Under Control by Maxim Romanovsky
php-user-group-minsk
 
Introduction To Web Development & The New Digital Workplace
Jen Wei Lee
 
Ad

More from Jeremy Coates (15)

PPTX
Cyber Security and GDPR
Jeremy Coates
 
PPTX
Aspect Oriented Programming
Jeremy Coates
 
PDF
Why is PHP Awesome
Jeremy Coates
 
PDF
Testing with Codeception
Jeremy Coates
 
KEY
Insects in your mind
Jeremy Coates
 
KEY
Hudson Continuous Integration for PHP
Jeremy Coates
 
PDF
The Uncertainty Principle
Jeremy Coates
 
PPT
Exploiting Php With Php
Jeremy Coates
 
ODP
What's new, what's hot in PHP 5.3
Jeremy Coates
 
PDF
Kiss Phpnw08
Jeremy Coates
 
PPT
Regex Basics
Jeremy Coates
 
ODP
Search Lucene
Jeremy Coates
 
PDF
Mysql Explain Explained
Jeremy Coates
 
ODP
Introduction to Version Control
Jeremy Coates
 
ODP
PHPNW Conference Update
Jeremy Coates
 
Cyber Security and GDPR
Jeremy Coates
 
Aspect Oriented Programming
Jeremy Coates
 
Why is PHP Awesome
Jeremy Coates
 
Testing with Codeception
Jeremy Coates
 
Insects in your mind
Jeremy Coates
 
Hudson Continuous Integration for PHP
Jeremy Coates
 
The Uncertainty Principle
Jeremy Coates
 
Exploiting Php With Php
Jeremy Coates
 
What's new, what's hot in PHP 5.3
Jeremy Coates
 
Kiss Phpnw08
Jeremy Coates
 
Regex Basics
Jeremy Coates
 
Search Lucene
Jeremy Coates
 
Mysql Explain Explained
Jeremy Coates
 
Introduction to Version Control
Jeremy Coates
 
PHPNW Conference Update
Jeremy Coates
 

Recently uploaded (20)

PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PPTX
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Why Your AI & Cybersecurity Hiring Still Misses the Mark in 2025
Virtual Employee Pvt. Ltd.
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
madgavkar20181017ppt McKinsey Presentation.pdf
georgschmitzdoerner
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
C Programming Basics concept krnppt.pptx
Karan Prajapat
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
How to Build a Scalable Micro-Investing Platform in 2025 - A Founder’s Guide ...
Third Rock Techkno
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 

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

  • 2. Who? Jeremy Coates, MD Magma Digital Ltd [email protected] @phpcodemonkey #phpnw linkedin.com/in/ jeremycoates facebook.com/jeremycoates
  • 3. PHPNW Manchester UK 5th year of event Tutorial Day - 5th October Conference - 6th & 7th October 400 attendees, 3 tracks, Unconf, Hackathon
  • 4. Content Phing Build System (basics) What is it / Why use it What can it do Example build files (+ live demo!) Phing & CI (Jenkins) Questions
  • 5. What's this Phing about? The TPhing Build system - Based on Ant (Apache) - PHP(5) based - No extra dependencies - Cross platform flickr.com/photos/
  • 6. I don't need no stinking 'Build System' Do you write PHP Apps or just web pages? - Configuration - Deployment - Committing - Testing - Documenting
  • 7. I don't need no stinking 'Build System' Do you write PHP Apps or just web pages? - Configuration - Preparation - Deployment - Predictability - Committing - Confidence - Testing - Documenting - Familiarity
  • 8. What can this Phing do? Pretty well everything bar make tea! Anything a shell script can do (FTP, SCP, Chown, Touch, SSH etc.) for deployment Integrate with version control (CVS, SVN, Git) Code quality checks (phpcs, pdepend, phpmd etc.)
  • 9. Oh is that all?
  • 10. 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
  • 11. What Phings can I use?
  • 12. How's it work? Phing shell script, launches Phing PHP App + your XML build file Build file contains: - Properties - Targets - Tasks flickr.com/photos/jm3/4814208649
  • 14. Example build script
  • 20. Continuous Integration Remove reliance on Human nature Regular automated builds (phing/ant) Report on build status
  • 21. CI Reports For many of the tools we're already familiar with Phing targets: - phpcs, pdepend, phpcpd, phpmd, phpunit, phpcb etc.
  • 23. Phing - context Phing vs. Ant: Ant is inspiration for Phing. Phing doesn't need JVM & is LGPL (Ant: Apache v2) Phing 1: PHP4 Phing 2: PHP5.2+ phing version 2.4.12 Michiel Rook: Project Lead @michieltcs
  • 24. Resources http://www.phing.info @phingofficial http://www.phing.info/docs/guide/stable/ http://jenkins-ci.org http://phpqatools.org http://dbdeploy.com / http://liquibase.org http://ant.apache.org
  • 26. Feedback? Jeremy Coates, MD Magma Digital Ltd Please provide feedback: https://joind.in/6392

Editor's Notes

  • #2: \n\n
  • #3: \n\n
  • #4: \n\n
  • #5: \n\n
  • #6: 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
  • #7: Web applications require deployment, packaging, testing, setting permissions, configuration, creating log files\nDoing so by hand every time is scary!\n
  • #8: \n\n
  • #9: \n\n
  • #10: \n\n
  • #11: Project: root XML node\nTargets: collection of tasks, together for a reason\nTasks: call to specific action e.g. copy, symlink etc.\n
  • #12: \n\n
  • #13: \n\n
  • #14: 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
  • #15: \n\n
  • #16: \n\n
  • #17: \n\n
  • #18: \n\n
  • #19: 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
  • #20: \n\n
  • #21: \n\n
  • #22: \n\n
  • #23: \n\n
  • #24: \n\n
  • #25: \n\n