SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Phing
           Automating PHP build deployment




09/07/12             http://coderinsights.blogspot.in   1
Old Way




09/07/12   http://coderinsights.blogspot.in   2
Why use Build Automation?
“We are human, We get bored,
We forget things, We make mistakes”

•   Improve product quality
•   Consolidate scripts
•   Eliminate repetitive tasks
•   Minimize error (bad builds)
•   Eliminate dependencies (Easier handover)
•   Highly extendible
•   Saves time

09/07/12                http://coderinsights.blogspot.in   3
What is [PHing Is Not Gnumake]
•   It's a PHP project build tool based on Apache Ant
•   Opensource
•   Mostly Cross platform
•   Uses XML build files
•   No required external dependencies
•   Built & optimised for PHP5




09/07/12              http://coderinsights.blogspot.in   4
What can you do?
•   Lots –Not just for deployment
•   SVN tasks
•   PHPUnit/SimpleTest
•   Code analysis tasks
•   PhpDocumentor
•   Zip/Unzip
•   File manipulation
•   Various OS tasks

09/07/12           http://coderinsights.blogspot.in   5
Features




09/07/12   http://coderinsights.blogspot.in   6
Phing Philosophy
• Build scripts contains "Targets"
      – Targets should be small and specialized.
      – Example Targets:
           • clean
              – Clear temporary and cached files
           • copy
              – Copy files to their intended destination
           • migrate
              – Upgrade the database schema



09/07/12                      http://coderinsights.blogspot.in   7
Phing Philosophy
• Targets can have dependencies
      – Target "live" can depend on clean, copy, and
        migrate
      – Meaning, when we run the "live" target, it first
        runs clean, copy, then migrate
           • And any tasks they depend on




09/07/12                   http://coderinsights.blogspot.in   8
Installing Phing
• pear channel-discover pear.phing.info
• pear install phing/Phing
• Want all the dependencies?
      –    pear   config-set preferred_state alpha
      –    pear   install –alldeps phing/Phing
      –    pear   config-set preferred_state stable
      –    pear   install phing/phingdocs
• Also available from:
      – SVN
      – Zip Download

09/07/12                 http://coderinsights.blogspot.in   9
Running Phing
• $> phing –v
      – Lists Phing version
• Phing expects to find a file "build.xml" in the
  current directory
      – build.xml defines the targets
      – You can use the "-f <filename>" flag to
        specify an alternate build file like
           • $> phing -f build-live.xml


09/07/12                http://coderinsights.blogspot.in   10
Syntax
• Build File uses XML
• Standard Elements
      – Task: code that performs a specific function
      – Target: groups of tasks
      – Project: root node
• Variables
      – ${variablename}
      – Conventions
           • Psuedo-Namespaces using periods
           • ${namespace.variable.name}

09/07/12                  http://coderinsights.blogspot.in   11
Basic Conventions
• build.xml
      – Central repository of your top-level tasks
• build-*.xml
      – Can be included into build.xml.
      – Usually for grouping by target (dev, staging,prod)
        or task (migrate, test, etc.)
• build.properties
      – Technically an INI file that contains variables to be
        included by build files.

09/07/12                http://coderinsights.blogspot.in     12
Basic build.xml
  <?xml version="1.0" encoding="UTF-8"?>
  <project name=“opx" default="default" basedir=".">
      <property file="build.properties" />
      <target name="default">
          <echo message="Hello World!" />
      </target>
  </project>




09/07/12              http://coderinsights.blogspot.in   13
Basic build.properties
  source.directory = /mnt/work/

  ## Database Configuration
  db.user = username
  db.pass = password
  db.host = localhost
  db.name = database


   Usage:
   $phing –propertyfile build.properties




09/07/12                        http://coderinsights.blogspot.in   14
Most Useful Elements
• Filesets: define once,use many
      <fileset id="src_crons" dir="${dir.crons_path}/statistic-engine/">
              <include name="*.php"/>
              <exclude name="populate_opx_tables.php" />
      </fileset>


• Mappers & Filters: Transform files during
  copy/move/…
      <copy todir="${build}">
             <fileset refid="files"/>
                     <mapper type="glob" from="*.txt" to="*.new.txt"/>
                     <filterchain>
                             <replaceregexp>
                             <regexp pattern="rn" replace="n"/>
                     <expandproperties/>
                     </replaceregexp>
             </filterchain>
      </copy>



09/07/12                                        http://coderinsights.blogspot.in   15
Executing External Tools
• Nearly all file transfer tools will be external
  commands
• For this we need the Exec task
      <exec command="cp file1 file2" />




09/07/12                http://coderinsights.blogspot.in   16
Examples
SVN, Git
<svncopy username=“pavan“ password="test” repositoryurl="svn://localhost/phing/trunk/“
    todir="svn://localhost/phing/tags/1.0"/>

<svnexport repositoryurl="svn://localhost/project/trunk/” todir="/home/pavan/dev"/>

<svnlastrevision repositoryurl="svn://localhost/project/trunk/” propertyname="lastrev"/>
<echo>Last revision: ${lastrev}</echo>

<svnlastrevision repositoryurl="${deploy.svn}” property="deploy.rev"/>

<svnexport repositoryurl="${deploy.svn}" todir="/www/releases/build-${deploy.rev}"/>




09/07/12                           http://coderinsights.blogspot.in                        17
Examples
Packaging – Tar/Zip
<tar compression="gzip" destFile="package.tgz" basedir="build"/>
    <zip destfile="htmlfiles.zip">
    <fileset dir=".">
            <include name="**/*.html"/>
    </fileset>
</zip>




09/07/12                           http://coderinsights.blogspot.in   18
Examples
Documentation:
      – DocBlox
      – PhpDocumentor
      – ApiGen

<docblox title="Phing API Documentation"
output="docs" quiet="true">
<fileset dir="../../classes">
     <include name="**/*.php"/>
</fileset>
</docblox>


09/07/12                          http://coderinsights.blogspot.in   19
Examples
• SCP/FTP
<scp username="john" password="smith" host="webserver" todir="/www/htdocs/project/">
    <fileset dir="test">
            <include name="*.html"/>
    </fileset>
</scp>

<ftpdeploy host="server01” username="john" password="smit" dir="/var/www">
    <fileset dir=".">
            <include name="*.html"/>
    </fileset>
</ftpdeploy>




09/07/12                         http://coderinsights.blogspot.in                      20
Database Migrations
• Set of delta SQL files (1-create-post.sql)
• Tracks current version of your db in changelog
  table
• Generates do and undo SQL files
CREATE TABLE changelog (
change_number BIGINT NOT NULL,
delta_set VARCHAR(10) NOT NULL,
start_dt TIMESTAMP NOT NULL,
complete_dt TIMESTAMP NULL,
applied_by VARCHAR(100) NOT NULL,
description VARCHAR(500) NOT NULL
)

09/07/12                  http://coderinsights.blogspot.in   21
Database Migrations
• Delta scripts with do (up) & undo (down) parts
-- //
CREATE TABLE ‘post‘ (
‘title‘ VARCHAR(255),
‘time_created‘ DATETIME,
‘content‘ MEDIUMTEXT
);
-- //@UNDO
DROP TABLE ‘post‘;
-- //




09/07/12                   http://coderinsights.blogspot.in   22
Database Migrations
<dbdeploy
url="sqlite:test.db"
dir="deltas"
outputfile="deploy.sql"
undooutputfile="undo.sql"/>

<pdosqlexec
src="deploy.sql"
url="sqlite:test.db"/>

Buildfile: /home/pavan/dbdeploy/build.xml
Demo > migrate:
[dbdeploy] Getting applied changed numbers from DB:
mysql:host=localhost;dbname=demo
[dbdeploy] Current db revision: 0
[dbdeploy] Checkall:
[pdosqlexec] Executing file: /home/michiel/dbdeploy/deploy.sql
[pdosqlexec] 3 of 3 SQL statements executed successfully
BUILD FINISHED



09/07/12                                       http://coderinsights.blogspot.in   23
Database Migrations
-- Fragment begins: 1 --
INSERT INTO changelog
(change_number, delta_set, start_dt, applied_by, description)
VALUES (1, ’Main’, NOW(), ’dbdeploy’,
’1-create_initial_schema.sql’);
--//
CREATE TABLE ‘post‘ (
‘title‘ VARCHAR(255),
‘time_created‘ DATETIME,
‘content‘ MEDIUMTEXT
);
UPDATE changelog
SET complete_dt = NOW()
WHERE change_number = 1
AND delta_set = ’Main’;
-- Fragment ends: 1 --

09/07/12                        http://coderinsights.blogspot.in   24
Database Migrations
-- Fragment begins: 1 --
DROP TABLE ‘post‘;
--//
DELETE FROM changelog
WHERE change_number = 1
AND delta_set = ’Main’;
-- Fragment ends: 1 --




09/07/12                   http://coderinsights.blogspot.in   25
Phing Way




09/07/12   http://coderinsights.blogspot.in   26
Pitfalls
• Cleanup Deleted Source Files
      – Usually only a problem when you have * include
        patterns
• Undefined properties not raised as an error
• Little to no IDE support (Minimal support
  using Ant Plugin for Eclipse)



09/07/12              http://coderinsights.blogspot.in   27
More!!
SAMPLE
https://bitbucket.org/arnavawasthi/php-phing
WEBSITE
http://phing.info
MAILING LISTS
users@phing.tigris.org
dev@phing.tigris.org

09/07/12         http://coderinsights.blogspot.in   28

Weitere ähnliche Inhalte

Was ist angesagt?

Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for Youhozn
 
Automated Deployment With Phing
Automated Deployment With PhingAutomated Deployment With Phing
Automated Deployment With PhingDaniel Cousineau
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentShahar Evron
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stackKris Buytaert
 
Propel Your PHP Applications
Propel Your PHP ApplicationsPropel Your PHP Applications
Propel Your PHP Applicationshozn
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsAdam Culp
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayPuppet
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshopNick Belhomme
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselPuppet
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Clark Everetts
 
Virtual Bolt Workshop - Dell - April 8 2020
Virtual Bolt Workshop - Dell - April 8 2020Virtual Bolt Workshop - Dell - April 8 2020
Virtual Bolt Workshop - Dell - April 8 2020Puppet
 
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)Puppet
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is DockerNick Belhomme
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginnersAdam Englander
 
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...Puppet
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxNick Belhomme
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeAndreas Jung
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package developmentTihomir Opačić
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8rajkumar2011
 

Was ist angesagt? (20)

Putting Phing to Work for You
Putting Phing to Work for YouPutting Phing to Work for You
Putting Phing to Work for You
 
Automated Deployment With Phing
Automated Deployment With PhingAutomated Deployment With Phing
Automated Deployment With Phing
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
 
11 tools for your PHP devops stack
11 tools for your PHP devops stack11 tools for your PHP devops stack
11 tools for your PHP devops stack
 
Propel Your PHP Applications
Propel Your PHP ApplicationsPropel Your PHP Applications
Propel Your PHP Applications
 
Practical PHP Deployment with Jenkins
Practical PHP Deployment with JenkinsPractical PHP Deployment with Jenkins
Practical PHP Deployment with Jenkins
 
Virtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
 
Zend Framework 1.8 workshop
Zend Framework 1.8 workshopZend Framework 1.8 workshop
Zend Framework 1.8 workshop
 
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
 
Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016Php Dependency Management with Composer ZendCon 2016
Php Dependency Management with Composer ZendCon 2016
 
Virtual Bolt Workshop - Dell - April 8 2020
Virtual Bolt Workshop - Dell - April 8 2020Virtual Bolt Workshop - Dell - April 8 2020
Virtual Bolt Workshop - Dell - April 8 2020
 
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)
Puppet Virtual Bolt Workshop - 23 April 2020 (Singapore)
 
Vagrant move over, here is Docker
Vagrant move over, here is DockerVagrant move over, here is Docker
Vagrant move over, here is Docker
 
Zend con 2016 bdd with behat for beginners
Zend con 2016   bdd with behat for beginnersZend con 2016   bdd with behat for beginners
Zend con 2016 bdd with behat for beginners
 
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...
Easily Manage Patching and Application Updates with Chocolatey + Puppet - Apr...
 
PHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBeneluxPHP Quality Assurance Workshop PHPBenelux
PHP Quality Assurance Workshop PHPBenelux
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package development
 
Getting started with Django 1.8
Getting started with Django 1.8Getting started with Django 1.8
Getting started with Django 1.8
 

Andere mochten auch

öZkan şAhin
öZkan şAhinöZkan şAhin
öZkan şAhinyardimt
 
SĂśZcĂźKte Anlam
SĂśZcĂźKte AnlamSĂśZcĂźKte Anlam
SĂśZcĂźKte Anlamyardimt
 
Tugbapalta
TugbapaltaTugbapalta
Tugbapaltayardimt
 
CĂźMlenyn Yapisi
CĂźMlenyn YapisiCĂźMlenyn Yapisi
CĂźMlenyn Yapisiyardimt
 
Group Profile
Group ProfileGroup Profile
Group Profileajaybc
 
Fler Sunusu
Fler SunusuFler Sunusu
Fler Sunusuyardimt
 
Are you a life-long learner?
Are you a life-long learner?Are you a life-long learner?
Are you a life-long learner?Jeremy Williams
 
「Rubyで描くビジネスモデル」池澤 一廣
「Rubyで描くビジネスモデル」池澤 一廣「Rubyで描くビジネスモデル」池澤 一廣
「Rubyで描くビジネスモデル」池澤 一廣toRuby
 
Economy in a nutshell
Economy in a nutshellEconomy in a nutshell
Economy in a nutshelladam.onionomics
 
Art 245 photo montage
Art 245 photo montageArt 245 photo montage
Art 245 photo montageJoseph DeLappe
 
Test First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTest First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTim Berglund
 
Kelime Tuerleri
Kelime TuerleriKelime Tuerleri
Kelime Tuerleriyardimt
 
Hurricanes In Sandwich
Hurricanes In  SandwichHurricanes In  Sandwich
Hurricanes In SandwichLucyGauthier
 
Yapilarina GĂśRe Isimler
Yapilarina GĂśRe IsimlerYapilarina GĂśRe Isimler
Yapilarina GĂśRe Isimleryardimt
 
Steps to change address online.
Steps to change address online.Steps to change address online.
Steps to change address online.Wassim Merheby
 
Increased FDI in defence manufacturing Press Note (7), 2014 series.
Increased FDI in defence manufacturing Press Note (7), 2014 series.Increased FDI in defence manufacturing Press Note (7), 2014 series.
Increased FDI in defence manufacturing Press Note (7), 2014 series.Ankur Gupta
 
Mevlananin Ogutlari
Mevlananin OgutlariMevlananin Ogutlari
Mevlananin Ogutlariyardimt
 
大川祐介
大川祐介大川祐介
大川祐介toRuby
 
Paragrafyn Yapysy
Paragrafyn YapysyParagrafyn Yapysy
Paragrafyn Yapysyyardimt
 

Andere mochten auch (20)

öZkan şAhin
öZkan şAhinöZkan şAhin
öZkan şAhin
 
Meat 2.0 vr7
Meat 2.0 vr7Meat 2.0 vr7
Meat 2.0 vr7
 
SĂśZcĂźKte Anlam
SĂśZcĂźKte AnlamSĂśZcĂźKte Anlam
SĂśZcĂźKte Anlam
 
Tugbapalta
TugbapaltaTugbapalta
Tugbapalta
 
CĂźMlenyn Yapisi
CĂźMlenyn YapisiCĂźMlenyn Yapisi
CĂźMlenyn Yapisi
 
Group Profile
Group ProfileGroup Profile
Group Profile
 
Fler Sunusu
Fler SunusuFler Sunusu
Fler Sunusu
 
Are you a life-long learner?
Are you a life-long learner?Are you a life-long learner?
Are you a life-long learner?
 
「Rubyで描くビジネスモデル」池澤 一廣
「Rubyで描くビジネスモデル」池澤 一廣「Rubyで描くビジネスモデル」池澤 一廣
「Rubyで描くビジネスモデル」池澤 一廣
 
Economy in a nutshell
Economy in a nutshellEconomy in a nutshell
Economy in a nutshell
 
Art 245 photo montage
Art 245 photo montageArt 245 photo montage
Art 245 photo montage
 
Test First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in GrailsTest First, Refresh Second: Web App TDD in Grails
Test First, Refresh Second: Web App TDD in Grails
 
Kelime Tuerleri
Kelime TuerleriKelime Tuerleri
Kelime Tuerleri
 
Hurricanes In Sandwich
Hurricanes In  SandwichHurricanes In  Sandwich
Hurricanes In Sandwich
 
Yapilarina GĂśRe Isimler
Yapilarina GĂśRe IsimlerYapilarina GĂśRe Isimler
Yapilarina GĂśRe Isimler
 
Steps to change address online.
Steps to change address online.Steps to change address online.
Steps to change address online.
 
Increased FDI in defence manufacturing Press Note (7), 2014 series.
Increased FDI in defence manufacturing Press Note (7), 2014 series.Increased FDI in defence manufacturing Press Note (7), 2014 series.
Increased FDI in defence manufacturing Press Note (7), 2014 series.
 
Mevlananin Ogutlari
Mevlananin OgutlariMevlananin Ogutlari
Mevlananin Ogutlari
 
大川祐介
大川祐介大川祐介
大川祐介
 
Paragrafyn Yapysy
Paragrafyn YapysyParagrafyn Yapysy
Paragrafyn Yapysy
 

Ähnlich wie Build Automation of PHP Applications

Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11Michelangelo van Dam
 
Intro to-ant
Intro to-antIntro to-ant
Intro to-antManav Prasad
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...buildacloud
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collabKaren Vuong
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011Bachkoutou Toutou
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis OverviewLeo Lorieri
 
Apache ant
Apache antApache ant
Apache antkoniik
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under controlMarcin PrzepiĂłrowski
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程jeffz
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Phase2
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesAlfresco Software
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Codemotion
 
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
WorkFlow:  An Inquiry Into Productivity by Timothy BoltonWorkFlow:  An Inquiry Into Productivity by Timothy Bolton
WorkFlow: An Inquiry Into Productivity by Timothy BoltonMiva
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbtFabio Fumarola
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the BasicsUlrich Krause
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkBryan Ollendyke
 

Ähnlich wie Build Automation of PHP Applications (20)

Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
 
Intro to-ant
Intro to-antIntro to-ant
Intro to-ant
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collab
 
Django
DjangoDjango
Django
 
Stress Free Deployment - Confoo 2011
Stress Free Deployment  - Confoo 2011Stress Free Deployment  - Confoo 2011
Stress Free Deployment - Confoo 2011
 
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
 
Apache ant
Apache antApache ant
Apache ant
 
Take your database source code and data under control
Take your database source code and data under controlTake your database source code and data under control
Take your database source code and data under control
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程
 
Write php deploy everywhere
Write php deploy everywhereWrite php deploy everywhere
Write php deploy everywhere
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
Best Practices for Development Deployment & Distributions: Capital Camp + Gov...
 
BP-6 Repository Customization Best Practices
BP-6 Repository Customization Best PracticesBP-6 Repository Customization Best Practices
BP-6 Repository Customization Best Practices
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
WorkFlow:  An Inquiry Into Productivity by Timothy BoltonWorkFlow:  An Inquiry Into Productivity by Timothy Bolton
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
 
An introduction to maven gradle and sbt
An introduction to maven gradle and sbtAn introduction to maven gradle and sbt
An introduction to maven gradle and sbt
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Pure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talkPure Speed Drupal 4 Gov talk
Pure Speed Drupal 4 Gov talk
 

KĂźrzlich hochgeladen

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 RobisonAnna Loughnan Colquhoun
 
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 organizationRadu Cotescu
 
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 AutomationSafe Software
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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 DevelopmentsTrustArc
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 2024Rafal Los
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
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)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

KĂźrzlich hochgeladen (20)

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
 
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
 
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
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Build Automation of PHP Applications

  • 1. Phing Automating PHP build deployment 09/07/12 http://coderinsights.blogspot.in 1
  • 2. Old Way 09/07/12 http://coderinsights.blogspot.in 2
  • 3. Why use Build Automation? “We are human, We get bored, We forget things, We make mistakes” • Improve product quality • Consolidate scripts • Eliminate repetitive tasks • Minimize error (bad builds) • Eliminate dependencies (Easier handover) • Highly extendible • Saves time 09/07/12 http://coderinsights.blogspot.in 3
  • 4. What is [PHing Is Not Gnumake] • It's a PHP project build tool based on Apache Ant • Opensource • Mostly Cross platform • Uses XML build files • No required external dependencies • Built & optimised for PHP5 09/07/12 http://coderinsights.blogspot.in 4
  • 5. What can you do? • Lots –Not just for deployment • SVN tasks • PHPUnit/SimpleTest • Code analysis tasks • PhpDocumentor • Zip/Unzip • File manipulation • Various OS tasks 09/07/12 http://coderinsights.blogspot.in 5
  • 6. Features 09/07/12 http://coderinsights.blogspot.in 6
  • 7. Phing Philosophy • Build scripts contains "Targets" – Targets should be small and specialized. – Example Targets: • clean – Clear temporary and cached files • copy – Copy files to their intended destination • migrate – Upgrade the database schema 09/07/12 http://coderinsights.blogspot.in 7
  • 8. Phing Philosophy • Targets can have dependencies – Target "live" can depend on clean, copy, and migrate – Meaning, when we run the "live" target, it first runs clean, copy, then migrate • And any tasks they depend on 09/07/12 http://coderinsights.blogspot.in 8
  • 9. Installing Phing • pear channel-discover pear.phing.info • pear install phing/Phing • Want all the dependencies? – pear config-set preferred_state alpha – pear install –alldeps phing/Phing – pear config-set preferred_state stable – pear install phing/phingdocs • Also available from: – SVN – Zip Download 09/07/12 http://coderinsights.blogspot.in 9
  • 10. Running Phing • $> phing –v – Lists Phing version • Phing expects to find a file "build.xml" in the current directory – build.xml defines the targets – You can use the "-f <filename>" flag to specify an alternate build file like • $> phing -f build-live.xml 09/07/12 http://coderinsights.blogspot.in 10
  • 11. Syntax • Build File uses XML • Standard Elements – Task: code that performs a specic function – Target: groups of tasks – Project: root node • Variables – ${variablename} – Conventions • Psuedo-Namespaces using periods • ${namespace.variable.name} 09/07/12 http://coderinsights.blogspot.in 11
  • 12. Basic Conventions • build.xml – Central repository of your top-level tasks • build-*.xml – Can be included into build.xml. – Usually for grouping by target (dev, staging,prod) or task (migrate, test, etc.) • build.properties – Technically an INI file that contains variables to be included by build files. 09/07/12 http://coderinsights.blogspot.in 12
  • 13. Basic build.xml <?xml version="1.0" encoding="UTF-8"?> <project name=“opx" default="default" basedir="."> <property file="build.properties" /> <target name="default"> <echo message="Hello World!" /> </target> </project> 09/07/12 http://coderinsights.blogspot.in 13
  • 14. Basic build.properties source.directory = /mnt/work/ ## Database Configuration db.user = username db.pass = password db.host = localhost db.name = database Usage: $phing –propertyfile build.properties 09/07/12 http://coderinsights.blogspot.in 14
  • 15. Most Useful Elements • Filesets: dene once,use many <fileset id="src_crons" dir="${dir.crons_path}/statistic-engine/"> <include name="*.php"/> <exclude name="populate_opx_tables.php" /> </fileset> • Mappers & Filters: Transform les during copy/move/… <copy todir="${build}"> <fileset refid="files"/> <mapper type="glob" from="*.txt" to="*.new.txt"/> <filterchain> <replaceregexp> <regexp pattern="rn" replace="n"/> <expandproperties/> </replaceregexp> </filterchain> </copy> 09/07/12 http://coderinsights.blogspot.in 15
  • 16. Executing External Tools • Nearly all file transfer tools will be external commands • For this we need the Exec task <exec command="cp file1 file2" /> 09/07/12 http://coderinsights.blogspot.in 16
  • 17. Examples SVN, Git <svncopy username=“pavan“ password="test” repositoryurl="svn://localhost/phing/trunk/“ todir="svn://localhost/phing/tags/1.0"/> <svnexport repositoryurl="svn://localhost/project/trunk/” todir="/home/pavan/dev"/> <svnlastrevision repositoryurl="svn://localhost/project/trunk/” propertyname="lastrev"/> <echo>Last revision: ${lastrev}</echo> <svnlastrevision repositoryurl="${deploy.svn}” property="deploy.rev"/> <svnexport repositoryurl="${deploy.svn}" todir="/www/releases/build-${deploy.rev}"/> 09/07/12 http://coderinsights.blogspot.in 17
  • 18. Examples Packaging – Tar/Zip <tar compression="gzip" destFile="package.tgz" basedir="build"/> <zip destfile="htmlfiles.zip"> <fileset dir="."> <include name="**/*.html"/> </fileset> </zip> 09/07/12 http://coderinsights.blogspot.in 18
  • 19. Examples Documentation: – DocBlox – PhpDocumentor – ApiGen <docblox title="Phing API Documentation" output="docs" quiet="true"> <fileset dir="../../classes"> <include name="**/*.php"/> </fileset> </docblox> 09/07/12 http://coderinsights.blogspot.in 19
  • 20. Examples • SCP/FTP <scp username="john" password="smith" host="webserver" todir="/www/htdocs/project/"> <fileset dir="test"> <include name="*.html"/> </fileset> </scp> <ftpdeploy host="server01” username="john" password="smit" dir="/var/www"> <fileset dir="."> <include name="*.html"/> </fileset> </ftpdeploy> 09/07/12 http://coderinsights.blogspot.in 20
  • 21. Database Migrations • Set of delta SQL files (1-create-post.sql) • Tracks current version of your db in changelog table • Generates do and undo SQL files CREATE TABLE changelog ( change_number BIGINT NOT NULL, delta_set VARCHAR(10) NOT NULL, start_dt TIMESTAMP NOT NULL, complete_dt TIMESTAMP NULL, applied_by VARCHAR(100) NOT NULL, description VARCHAR(500) NOT NULL ) 09/07/12 http://coderinsights.blogspot.in 21
  • 22. Database Migrations • Delta scripts with do (up) & undo (down) parts -- // CREATE TABLE ‘post‘ ( ‘title‘ VARCHAR(255), ‘time_created‘ DATETIME, ‘content‘ MEDIUMTEXT ); -- //@UNDO DROP TABLE ‘post‘; -- // 09/07/12 http://coderinsights.blogspot.in 22
  • 23. Database Migrations <dbdeploy url="sqlite:test.db" dir="deltas" outputfile="deploy.sql" undooutputfile="undo.sql"/> <pdosqlexec src="deploy.sql" url="sqlite:test.db"/> Buildfile: /home/pavan/dbdeploy/build.xml Demo > migrate: [dbdeploy] Getting applied changed numbers from DB: mysql:host=localhost;dbname=demo [dbdeploy] Current db revision: 0 [dbdeploy] Checkall: [pdosqlexec] Executing file: /home/michiel/dbdeploy/deploy.sql [pdosqlexec] 3 of 3 SQL statements executed successfully BUILD FINISHED 09/07/12 http://coderinsights.blogspot.in 23
  • 24. Database Migrations -- Fragment begins: 1 -- INSERT INTO changelog (change_number, delta_set, start_dt, applied_by, description) VALUES (1, ’Main’, NOW(), ’dbdeploy’, ’1-create_initial_schema.sql’); --// CREATE TABLE ‘post‘ ( ‘title‘ VARCHAR(255), ‘time_created‘ DATETIME, ‘content‘ MEDIUMTEXT ); UPDATE changelog SET complete_dt = NOW() WHERE change_number = 1 AND delta_set = ’Main’; -- Fragment ends: 1 -- 09/07/12 http://coderinsights.blogspot.in 24
  • 25. Database Migrations -- Fragment begins: 1 -- DROP TABLE ‘post‘; --// DELETE FROM changelog WHERE change_number = 1 AND delta_set = ’Main’; -- Fragment ends: 1 -- 09/07/12 http://coderinsights.blogspot.in 25
  • 26. Phing Way 09/07/12 http://coderinsights.blogspot.in 26
  • 27. Pitfalls • Cleanup Deleted Source Files – Usually only a problem when you have * include patterns • Undefined properties not raised as an error • Little to no IDE support (Minimal support using Ant Plugin for Eclipse) 09/07/12 http://coderinsights.blogspot.in 27

Hinweis der Redaktion

  1. We are human We get bored We forget things We make mistakes Repetitive tasks like Versioncontrol (Unit)Testing Conguring Packaging Uploading DBchanges
  2. Phing is Recursive acronym In its simplest form, Phing allows you to copy code from your source control repository (SVN or Git) to your server via SSH, and perform pre and post-deploy functions like restarting a webserver, busting cache, renaming files, running database migrations and so on. With Phing it’s also possible to deploy to many machines at once. Original PHP4 version by Andreas Aderhold Cross-platform(for Windows) Build Systems Apache ANT Capastrano Plain PHP or BASH or BAT Files
  3. Interface to various popular (PHP)tools
  4. Introduced facade targets • Moved all the properties out • Used properties for configurability • Defined and reused elements with ids • Use of reflexives and replacements • Separating build files
  5. Optional documentation Pear install phing/phingdocs
  6. Other useful options: – Help (-h) – Specify properties (-D propname=value) – List targets (-l) – Get more output (-verbose or -debug)
  7. Task : code that performs a specic function (svncheckout, mkdir,etc.) Target : groups of tasks, can optionally depend on other targets Project : root node, contains multiple targets
  8. Mappers: Change lename Flatten directories Filters: Strip comments, whitespace Replace values Perform XSLT transformation Translation(i18n)