SlideShare uma empresa Scribd logo
1 de 25
Who?
Jeremy Coates, MD Magma
Digital Ltd

jeremy@phpnw.org.uk

@phpcodemonkey

#phpnw

linkedin.com/in/
jeremycoates

facebook.com/jeremycoates
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)

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

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

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

http://jenkins-ci.org

http://dbdeploy.com

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

Jeremy Coates, MD
Magma Digital Ltd

Please provide
feedback:

https://joind.in/4759

Mais conteúdo relacionado

Mais procurados

Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environments
Artem Kovardin
 
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone beforeJAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
jazoon13
 
镐京入场培训.Key
镐京入场培训.Key镐京入场培训.Key
镐京入场培训.Key
Bean Tsang
 

Mais procurados (20)

Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)Organizing Your PHP Projects (2010 ConFoo)
Organizing Your PHP Projects (2010 ConFoo)
 
PHP Files: An Introduction
PHP Files: An IntroductionPHP Files: An Introduction
PHP Files: An Introduction
 
Tech talk: PHP
Tech talk: PHPTech talk: PHP
Tech talk: PHP
 
Using Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websitesUsing Composer to create manageable WordPress websites
Using Composer to create manageable WordPress websites
 
Elixir koans
Elixir koansElixir koans
Elixir koans
 
Python for web development
Python for web developmentPython for web development
Python for web development
 
Best practices-for-production-environments
Best practices-for-production-environmentsBest practices-for-production-environments
Best practices-for-production-environments
 
How to manage an open source project
How to manage an open source projectHow to manage an open source project
How to manage an open source project
 
Frontend testing with Codeception
Frontend testing with CodeceptionFrontend testing with Codeception
Frontend testing with Codeception
 
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone beforeJAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
JAZOON'13 - Andres Almiray - Spock: boldly go where no test has gone before
 
镐京入场培训.Key
镐京入场培训.Key镐京入场培训.Key
镐京入场培训.Key
 
Surgeons guide plugin development
Surgeons guide plugin developmentSurgeons guide plugin development
Surgeons guide plugin development
 
Golang
GolangGolang
Golang
 
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming LanguageATO 2014 - So You Think You Know 'Go'? The Go Programming Language
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
 
Groovy and noteworthy
Groovy and noteworthyGroovy and noteworthy
Groovy and noteworthy
 
FTC Robot C to Java
FTC Robot C to JavaFTC Robot C to Java
FTC Robot C to Java
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016 Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
 
Building New on Top of Old: The Argument for Simplicity
Building New on Top of Old: The Argument for SimplicityBuilding New on Top of Old: The Argument for Simplicity
Building New on Top of Old: The Argument for Simplicity
 
Web to App:作業系統革命 Firefox OS
Web to App:作業系統革命  Firefox OSWeb to App:作業系統革命  Firefox OS
Web to App:作業系統革命 Firefox OS
 

Semelhante a An introduction to Phing the PHP build system

Php day 20 11 e xo continuousintegration php
Php day 20 11 e xo continuousintegration phpPhp day 20 11 e xo continuousintegration php
Php day 20 11 e xo continuousintegration php
Quang Anh Le
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings
10n Software, LLC
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
Joshua Warren
 

Semelhante a An introduction to Phing the PHP build system (20)

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)
An introduction to Phing the PHP build system (PHPDay, May 2012)
 
Php Development Stack
Php Development StackPhp Development Stack
Php Development Stack
 
Php Development Stack
Php Development StackPhp Development Stack
Php Development Stack
 
Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)Enterprise PHP (PHP London Conference 2008)
Enterprise PHP (PHP London Conference 2008)
 
Slim PHP when you don't need the kitchen sink
Slim PHP   when you don't need the kitchen sinkSlim PHP   when you don't need the kitchen sink
Slim PHP when you don't need the kitchen sink
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
Continuous integration php
Continuous integration phpContinuous integration php
Continuous integration php
 
Php day 20 11 e xo continuousintegration php
Php day 20 11 e xo continuousintegration phpPhp day 20 11 e xo continuousintegration php
Php day 20 11 e xo continuousintegration php
 
Slides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetingsSlides from LAX & DEN usergroup meetings
Slides from LAX & DEN usergroup meetings
 
Deploy a PHP App on Google App Engine
Deploy a PHP App on Google App EngineDeploy a PHP App on Google App Engine
Deploy a PHP App on Google App Engine
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
Continuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon OttoContinuous Delivery for Python Developers – PyCon Otto
Continuous Delivery for Python Developers – PyCon Otto
 
LVPHP.org
LVPHP.orgLVPHP.org
LVPHP.org
 
Building a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanelBuilding a fully API-based platform on top of cPanel
Building a fully API-based platform on top of cPanel
 
Deploy a php app on Google App Engine
Deploy a php app on Google App EngineDeploy a php app on Google App Engine
Deploy a php app on Google App Engine
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.
 
Unleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ PlatformUnleash your Symfony projects with eZ Platform
Unleash your Symfony projects with eZ Platform
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
Agile == Dynamic?
Agile == Dynamic?Agile == Dynamic?
Agile == Dynamic?
 

Mais de Jeremy Coates

Search Lucene
Search LuceneSearch Lucene
Search Lucene
Jeremy Coates
 

Mais de Jeremy Coates (15)

Cyber Security and GDPR
Cyber Security and GDPRCyber Security and GDPR
Cyber Security and GDPR
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Why is PHP Awesome
Why is PHP AwesomeWhy is PHP Awesome
Why is PHP Awesome
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Insects in your mind
Insects in your mindInsects in your mind
Insects in your mind
 
Hudson Continuous Integration for PHP
Hudson Continuous Integration for PHPHudson Continuous Integration for PHP
Hudson Continuous Integration for PHP
 
The Uncertainty Principle
The Uncertainty PrincipleThe Uncertainty Principle
The Uncertainty Principle
 
Exploiting Php With Php
Exploiting Php With PhpExploiting Php With Php
Exploiting Php With Php
 
What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3What's new, what's hot in PHP 5.3
What's new, what's hot in PHP 5.3
 
Kiss Phpnw08
Kiss Phpnw08Kiss Phpnw08
Kiss Phpnw08
 
Regex Basics
Regex BasicsRegex Basics
Regex Basics
 
Search Lucene
Search LuceneSearch Lucene
Search Lucene
 
Mysql Explain Explained
Mysql Explain ExplainedMysql Explain Explained
Mysql Explain Explained
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
PHPNW Conference Update
PHPNW Conference UpdatePHPNW Conference Update
PHPNW Conference Update
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

An introduction to Phing the PHP build system

  • 1.
  • 2. Who? Jeremy Coates, MD Magma Digital Ltd jeremy@phpnw.org.uk @phpcodemonkey #phpnw linkedin.com/in/ jeremycoates facebook.com/jeremycoates
  • 3. Content Phing Build System (basics) What is it / Why use it What can it do Example build files (+ live demo!) Phing & CI (Jenkins) Questions
  • 4. What's this Phing about? The TPhing Build system - Based on Ant (Apache) - PHP(5) based - No extra dependencies - Cross platform flickr.com/photos/
  • 5. I don't need no stinking 'Build System' Do you write PHP Apps or just web pages? - Configuration - Deployment - Committing - Testing - Documenting
  • 6. 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
  • 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 deployment Integrate with version control (CVS, SVN, Git) Code quality checks (phpcs, pdepend, phpmd etc.)
  • 8. Oh is that all?
  • 9. Oh is that all? Unit tests (phpunit, simpletest) Database deployment (dbdeploy) Lint (PHP, JS, XML) Reporting (code coverage, PHPDoc, DocBLox) Not enough? Write your own Tasks or Exec
  • 10. What Phings can I use?
  • 11. 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
  • 13. Example build script
  • 14.
  • 19. Continuous Integration Remove reliance on Human nature Regular automated builds (phing/ant) Report on build status
  • 20. CI Reports For many of the tools we're already familiar with Phing targets: - phpcs, pdepend, phpcpd, phpmd, phpunit, phpcb etc.
  • 21.
  • 22. 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.9 Michiel Rook: Project Lead @michieltcs
  • 23. Resources http://www.phing.info @phingofficial http://www.phing.info/docs/guide/ stable/ http://jenkins-ci.org http://dbdeploy.com http://ant.apache.org
  • 25. Feedback? Jeremy Coates, MD Magma Digital Ltd Please provide feedback: https://joind.in/4759

Notas do Editor

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