SlideShare a Scribd company logo
1 of 29
Download to read offline
USING PHING
FOR FUN AND
PROFIT
PHING: A PHP BUILD SYSTEM
Nic Jansma
nicj.net
@NicJ
PHING

Phing is a cross-platform PHP build tool, similar to Apache
Ant.
WHAT IS A BUILD TOOL?
A build tool helps you automate repetitive tasks.
A BUILD TOOL HELPS
YOU...

Build resources (CSS, JavaScript, templates, etc)
Validate code (lint, sniff, etc)
Run unit tests
Build documentation
Create packages
Deploy code
Execute system commands
... and anything else you do repetitively ...
WHY USE A BUILD TOOL?

Otherwise you will f*** up.
You should automate everything you can.
Automating your processes will save you time.
Automating your processes will save you from your future
self.
Maybe not today, maybe not tomorrow, but at some point
you will make a mistake if it's not automated.
WHY USE PHING?

It's written in PHP, so if the rest of your project is PHP, you
can run Phing.
Besides PHP, no other external dependencies are needed
(such as Ruby or Java).
Great community support, with hundreds of different tasks.
INSTALLATION - GITHUB
github.com/phingofficial/phing

$ gt c oe ht s / gt u .o /h no fc a /h n. i
> i l n tp : /i hb cm p ig fi il pi g gt
$ pp p ig bn pi g
> h h n i h n
INSTALLATION - PHAR
PACKAGE
www.phing.info/trac/wiki/Users/Download

$ w e h t : / w . h n . n o g t p i g l t s . h r - p i gp a
> g t tp /w wp ig i f / e/ hn -a e tp a O hn .h r
$ pp p ig pa
> h h n. hr
INSTALLATION - PEAR
$ pa c an ld s oe p a. hn .n o
> e r hn e- ic vr e rp i gi f
$ pa i sa lp i gp ig
> e r nt l hn /h n
$ pi g
> hn
INSTALLATION COMPOSER
composer.json:

{
" eu r" {
r q ie :
"hn /h n " " . ."
pi gp ig : 26 1
}
}

$ pp c mo e. hr is a l
> h o ps rp a n tl
L ai gc mo e rp st r e w t pc ae i fr ai n
o dn op sr e oi oi s ih a kg n om t o
I sa ln d pn ec e (n ld n rq ie d v
n tl i g e ed n is i cu ig e ur -e )
-I sa ln p ig pi g (. .)
n t li g h n/h n 26 1
D wl ai g 10
o n od n: 0 %
W ii gl c fl
r tn ok ie
G nr tn a tl a fl s
e ea i g u oo d ie
$ pp v no h n hn  i hn
> h e dr pi g pi g b np i g
PHING OVERVIEW

Phing is driven by XML files that define your projects, build
targets, and individual tasks.
The XML format is very similar to Apache Ant.
PHING - PROJECTS

A project is the root element of your XML.
The < r j c >defines of all of your build targets and the
poet
tasks that will execute for the targets.
Only the d f u tattribut is required, which specifies the
eal
default target to run.
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "u l"
p oe t ae "y p oe t ea l =b id >
< - tr es ad ts s ->
! - ag t n a k < - .. ->
!- . <po et
/rj c >
PHING - TARGETS

A < a g t is a logical set of actions you want to take.
tre>
A < a g t can have tasks.
tre>
A < a g t can also have a list of other targets it depends
tre>
on.
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "u l"
p oe t ae "y p oe t ea l =b id >
< ag tn m=b id d pn s" la ,i t mn f"/
t r e ae"u l" e ed = ce nl n, ii y >
< ag tn m=c en >
t r e ae"l a"
<co mg " ' c e nn y u b id /
eh s =I m la ig o r ul " >
<tr e >
/a gt
< - .. ->
!- . <po et
/rj c >
PHING - TASKS

A task will take an action.
Tasks can be a core task that Phing ships with, or an external
plug-in that you write.
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "u l"
p oe t ae "y p oe t ea l =b id >
< ag tn m=c en >
t r e ae"l a"
<co mg " ' c e nn y u b id /
eh s =I m la ig o r ul " >
<ee e d r"u l" /
dl t i=bi d >
<tr e >
/a gt
<po et
/rj c >
PHING - CORE TASKS

123 built-in tasks.
Some of the most useful:
File operations: a p n , c p , d l t , m d r
ped oy eee ki
Conditional logic: c n i i n f r a h i , f i
odto, oec, f al
Input / output: e h , i p t
co nu
System: e e , t t m , t s d f
xc sap ake
Source control: g t , s n , c s
i* v* v*
Network: f p e l y h t g t m i , s p t s p s h
tdpo, tpe, al 3u, c, s
External Libraries: p p o e n f e , p p n t
hcdsifr hui,
p p o u e t rj l n , p p d
hdcmno, sit hm
PHING - PROPERTIES

A property is a variable.
Properties can come from built-in properties (Phing
environment variables), a b i d p o e t e file, or
ul.rpris
created at runtime in your XML file via the < r p r y
poet>
element.
Use properties via the $ p o e t n m }syntax.
{rpryae
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "l a"
p oe t ae "y p oe t ea l =c en >
< rp ry nm = bi di "v l e" /u l" /
p o et a e" ul d r au=. bi d >
< ag tn m=c en >
t r e ae"l a"
<co mg " ' c e nn $ bi di } /
eh s =I m la ig { ul dr " >
<ee e d r"{ ul dr " /
dl t i=$b i di } >
<tr e >
/a gt
<po et
/rj c >
PHING - BUILT-IN
PROPERTIES

There are many built-in properties:
apiainsati,ev* hs.rh
plcto.trdr n., otac,
hs.oan hs.sye hs.ae hs.s
otdmi, otftp, otnm, oto,
hs.srlae hs.svrin
oto.ees, oto.eso,
ln.eaao,o.ae pigfl,
iesprtr snm, hn.ie
pigdr pighm,pigvrin
hn.i, hn.oe hn.eso,
pigpoetnm,ppcasah
hn.rjc.ae h.lspt,
ppvrin poetbsdr ue.oe
h.eso, rjc.aei, srhm
PHING - .PROPERTIES
FILES
Simple k y v l eformat
e=au

#Ti i ac me t i t e .r pr is fl
hs s
om n n h po e te i e
k yv le
e =a u
b id i= ul
u ld r bi d
m ap nm =o
y p. a ef o
m ap ul ht :/ o .o
y p. r =t p/ fo cm

< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "l a"
p o e t a e " y p o e t e a l =c e n >
< rp ry fl = .b id po e te "/
p o et i e" /u l .r pr is >
< ag tn m= c en >
t r e ae "l a"
< co mg " ' c e nn $ bi di }f r$ m ap nm } /
eh s =I m la ig { ul dr o {y p. a e" >
<ee e d r"{ ul dr " /
dl t i= $b i di } >
< tr e>
/ a gt
< po et
/ rj c>
PHING - < R P R Y
POET>
Define new properties in your XML.
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "u l"
p o e t a e " y p o e t e a l =b i d >
< rp ry nm = bi di "v l e" /u l" /
p o et a e" ul d r au =. bi d >
< rp ry nm = cs i"vl e "{ ul }c s /
p o et a e" sd r a u= $b id / s" >
< rp ry nm = jd r vl e"{u l} j "/
p o et a e" si " au =$b id /s >
< ag tn m= c en >
t r e ae "l a"
<ee e d r"{ sd r"/
dl t i= $c s i} >
<ee e d r"{ si } /
dl t i= $j d r" >
< tr e>
/ a gt
< po et
/ rj c>
EXAMPLES
SIMPLE
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "c o >
p oe t ae "y p oe t ea l =e h"
< ag tn m=e h"
t r e ae"c o >
<co mg " el "/
eh s =H lo >
<tr e >
/a gt
<po et
/rj c >

> pi geh
$ h n co
B id ie . bi dx l
u lf l :  ul . m
m -r jc > eh :
y po e t
co
[ c o H lo
eh ] el
B ID FN SE
U L I IH D
T tl tm :0 18 s cn s
o a i e .7 0 eo d
TWO TASKS
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "i s"
p oe t ae "y p oe t ea l =f rt >
< ag tn m=f rt d pn s" eo d /
t r e ae"i s" e ed = sc n" >
< ag tn m=s cn "
t r e ae"e od >
<al ms a e" o ms e u" /
fi e sg =Y u es d p >
<tr e >
/a gt
<po et
/rj c >

> pi g fr t
$ h n is
B id ie . bi dx l
u lf l:  ul . m
m -r jc > sc n :
y po e t
eo d
E eu in o tr e "e od f ie f rt ef lo i gr ao :
x ct o f ag t sc n " a l d o h ol wn e s n
. bi dx l1: 2 Y u ms e u
 u l. m: 62 : o es d p
B ID FI E
U L A LD
. bi dx l1:2 Y um s e u
 ul . m: 62 : o es d p
T tl tm :0 10 s cn s
o a i e .8 0 eo d
SHELL COMMANDS
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "e ly >
p oe t ae "y p oe t ea l =d po "
< rp rynm = dp o. ot a e v le " o. o"/
p o et a e" el y hs nm " au=f oc m >
< ag tn m=d po "
t r e ae"e ly >
<xc
ee
c ma d"s n -v . $d po . ot ae /
om n=ry z az / { el yh sn m }"
d r" { rj c. ae i }
i= $p oe t bs dr "
c ek e un"r e /
hc rt r=t u" >
<tr e >
/a gt
<po et
/rj c >
EXTERNAL PHP
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =m -r jc " df ut "x en l ak >
p oe t ae "y p oe t ea l =e tr at s"
< ag tn m=e tr at s"
t r e ae"x en l ak >
<ak e
ts df
n m=m po et ak
ae"y rj c ts "
c as a h" {r jc . ae i}
ls pt=$ p oe tb sd r"
c as a e" ya k / <- .M T s. h ->
ls nm=M T s" > !- / ya kp p <yr jc t s m s ae'i /
mp oe ta k es g=h ' >
<tr e >
/a gt
<po et
/rj c >

< pp
?h
r qi eo c 'h n/ ak p p;
e ur _ ne pi g Ts .h '
c as MT s et ns Ts {
l s y ak xe d a k
p oe td $e s g;
r t ce m sa e
/ s tf o t e ts ' at iu ei t eX L
/ e r m h ak s tr b t n h M
p bi f nt o st es g (m sa e {
u l c u ci n eM s ae $e sg )
$ hs>e s g = $ es g;
ti-m sa e
m sa e
}
/ e eu e w e ts i c le
/ x ct d hn a k s a l d
p bi f nt o mi ( {
u l c u ci n an )
e h $h s> es g ;
co ti - ms ae
}
EXTERNAL PHP - OUTPUT
$ pi ge tr at s
> hn xe nl ak
B id ie . bi d x l
u lf l :  ul . m
[ rp r y L ai g .b id po e te
po et ] od n u l .r pr is
m -r jc > et ra ts :
y po e t
xe n la k
h
i
B ID FN SE
U L I IH D
T tl tm :0 23 s cn s
o a i e .9 0 eo d
CONTINUOUS
INTEGRATION / BUILD
SERVER
< xl vr in ". " ec dn =U F 8?
? m e so =1 0 no i g" T- ">
< rj c nm =b gp oe t df u t" ul "
p oe t ae "i - rj c" e al =b id >
< - mi tr e s- >
! - an a gt < ag tn m=b id d pn s" la ,h c ot ln ,
t r e ae"u l" e ed = ce nc ek u, i t
s if pp d ts ,o ,a k g" /
nf ,h m, et d cp ca e >
< ag tn m=d po "d pn s"u l, r- el y ry cr la e /
t r e ae"e ly ee d=bi dp e dp o, sn , ee s" >
< ag tn m=c en >
t r e ae"l a"
< - ce nt eb i d- >
!- la h ul <tr e >
/a gt
< ag tn m=c ek u"
t r e ae"h co t >
< - ce ku / pl l ts f o s u c c n rl ->
!- hc o t
u l a e t r m or e ot o <tr e >
/a gt
< ag tn m=l n" dp ns " hl n, si tc s it /
t r e ae"i t e ed =p pi tj l n, sl n" >
< ag tn m=p pi t>
t r e ae"h ln "
< - pp ln a l* pp f ls ->
!- h i t l .h i e <tr e >
/a gt
< ag tn m=j ln "
t r e ae"s it >
DOWNSITDES

Learning curve if you're not familiar with Ant.
Asynchronous operation, so large builds/deploys may be
slow.
Not everything is available on all OSs.
CONCLUSION
1. Use Phing
2. ???
3. Profit!
CONCLUSION

Phing is a great way to automate repetitive tasks.
Phing can be as simple or complex (and powerful) as you
make it.
Phing can save time and reduce human error.
More Info:
phing.info
Jenkins integration
Jetbrains PhpStorm integration
Eclipse integration
Thanks - Nic Jansma - nicj.net - @NicJ

More Related Content

What's hot

密瑪學原理與技術
密瑪學原理與技術密瑪學原理與技術
密瑪學原理與技術David Liao
 
網路攻擊技術分析
網路攻擊技術分析網路攻擊技術分析
網路攻擊技術分析David Liao
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony componentsMichael Peacock
 
Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Sawood Alam
 
Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Damien Seguy
 
TypeScriptで書くAngularJS @ GDG神戸2014.8.23
TypeScriptで書くAngularJS @ GDG神戸2014.8.23TypeScriptで書くAngularJS @ GDG神戸2014.8.23
TypeScriptで書くAngularJS @ GDG神戸2014.8.23Okuno Kentaro
 
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Mu Chun Wang
 
モダンAngularJS @ GDG中国2014.12.6
モダンAngularJS @ GDG中国2014.12.6モダンAngularJS @ GDG中国2014.12.6
モダンAngularJS @ GDG中国2014.12.6Okuno Kentaro
 
PHP an intro -1
PHP an intro -1PHP an intro -1
PHP an intro -1Kanchilug
 
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...Fabien Gandon
 
Linux Commands
Linux CommandsLinux Commands
Linux Commandsiwata
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tsArif Alexi
 
Perl в хэке и хэки в Perl
Perl в хэке и хэки в PerlPerl в хэке и хэки в Perl
Perl в хэке и хэки в Perlmayperl
 
Tong Hop Bai Tap C
Tong Hop Bai Tap CTong Hop Bai Tap C
Tong Hop Bai Tap CSamQuiDaiBo
 

What's hot (19)

密瑪學原理與技術
密瑪學原理與技術密瑪學原理與技術
密瑪學原理與技術
 
網路攻擊技術分析
網路攻擊技術分析網路攻擊技術分析
網路攻擊技術分析
 
Refactoring to symfony components
Refactoring to symfony componentsRefactoring to symfony components
Refactoring to symfony components
 
Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015Profiling Web Archives IIPC GA 2015
Profiling Web Archives IIPC GA 2015
 
Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020
 
TypeScriptで書くAngularJS @ GDG神戸2014.8.23
TypeScriptで書くAngularJS @ GDG神戸2014.8.23TypeScriptで書くAngularJS @ GDG神戸2014.8.23
TypeScriptで書くAngularJS @ GDG神戸2014.8.23
 
Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討Web應用程式以及資安問題的探討
Web應用程式以及資安問題的探討
 
モダンAngularJS @ GDG中国2014.12.6
モダンAngularJS @ GDG中国2014.12.6モダンAngularJS @ GDG中国2014.12.6
モダンAngularJS @ GDG中国2014.12.6
 
PHP an intro -1
PHP an intro -1PHP an intro -1
PHP an intro -1
 
c99
c99c99
c99
 
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...
Web Sémantique ou comment les ontologies pourront favoriser l\'échange des co...
 
Fast api
Fast apiFast api
Fast api
 
Send.php
Send.phpSend.php
Send.php
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
https://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=tshttps://www.facebook.com/valdyna.monna?fref=ts
https://www.facebook.com/valdyna.monna?fref=ts
 
Perl в хэке и хэки в Perl
Perl в хэке и хэки в PerlPerl в хэке и хэки в Perl
Perl в хэке и хэки в Perl
 
Speeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorallSpeeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorall
 
Tong Hop Bai Tap C
Tong Hop Bai Tap CTong Hop Bai Tap C
Tong Hop Bai Tap C
 
Show messagehello
Show messagehelloShow messagehello
Show messagehello
 

Viewers also liked

Using Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsUsing Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsNicholas Jansma
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsNicholas Jansma
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Nicholas Jansma
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsNicholas Jansma
 
Html5 devconf nodejs_devops_shubhra
Html5 devconf nodejs_devops_shubhraHtml5 devconf nodejs_devops_shubhra
Html5 devconf nodejs_devops_shubhraShubhra Kar
 
Measuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsMeasuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsNicholas Jansma
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module PatternsNicholas Jansma
 
Measuring Real User Performance in the Browser
Measuring Real User Performance in the BrowserMeasuring Real User Performance in the Browser
Measuring Real User Performance in the BrowserNicholas Jansma
 

Viewers also liked (11)

Using Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web ApplicationsUsing Modern Browser APIs to Improve the Performance of Your Web Applications
Using Modern Browser APIs to Improve the Performance of Your Web Applications
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
 
Measuring Continuity
Measuring ContinuityMeasuring Continuity
Measuring Continuity
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)
 
Sails.js Intro
Sails.js IntroSails.js Intro
Sails.js Intro
 
Forensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance InvestigationsForensic Tools for In-Depth Performance Investigations
Forensic Tools for In-Depth Performance Investigations
 
Html5 devconf nodejs_devops_shubhra
Html5 devconf nodejs_devops_shubhraHtml5 devconf nodejs_devops_shubhra
Html5 devconf nodejs_devops_shubhra
 
Measuring the Performance of Single Page Applications
Measuring the Performance of Single Page ApplicationsMeasuring the Performance of Single Page Applications
Measuring the Performance of Single Page Applications
 
Javascript Module Patterns
Javascript Module PatternsJavascript Module Patterns
Javascript Module Patterns
 
Measuring Real User Performance in the Browser
Measuring Real User Performance in the BrowserMeasuring Real User Performance in the Browser
Measuring Real User Performance in the Browser
 

Similar to Using Phing for Fun and Profit

PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!Blanca Mancilla
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with GradleBob Paulin
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamHenryk Konsek
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsMiloš Sutanovac
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 DISID
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidSomenath Mukhopadhyay
 
톰캣 #05+a-배치-parallel deployment
톰캣 #05+a-배치-parallel deployment톰캣 #05+a-배치-parallel deployment
톰캣 #05+a-배치-parallel deploymentGyuSeok Lee
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAwesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAjeet Singh Raina
 
From simple to more advanced: Lessons learned in 13 months with Tableau
From simple to more advanced: Lessons learned in 13 months with TableauFrom simple to more advanced: Lessons learned in 13 months with Tableau
From simple to more advanced: Lessons learned in 13 months with TableauSergii Khomenko
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsHeroku
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaTony Fabeen
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporationHenryk Konsek
 
Testing TYPO3 Applications
Testing TYPO3 ApplicationsTesting TYPO3 Applications
Testing TYPO3 ApplicationsAndré Wuttig
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing androidDroidcon Berlin
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type PluginJan Wilson
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and CustomizationAniket Pant
 
Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementAnne Nicolas
 

Similar to Using Phing for Fun and Profit (20)

PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
Continuous delivery with Gradle
Continuous delivery with GradleContinuous delivery with Gradle
Continuous delivery with Gradle
 
JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
Testing Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax ExamTesting Fuse Fabric with Pax Exam
Testing Fuse Fabric with Pax Exam
 
An Introduction to CSS Preprocessors
An Introduction to CSS PreprocessorsAn Introduction to CSS Preprocessors
An Introduction to CSS Preprocessors
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
Flow of events during Media Player creation in Android
Flow of events during Media Player creation in AndroidFlow of events during Media Player creation in Android
Flow of events during Media Player creation in Android
 
톰캣 #05+a-배치-parallel deployment
톰캣 #05+a-배치-parallel deployment톰캣 #05+a-배치-parallel deployment
톰캣 #05+a-배치-parallel deployment
 
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar PradhanAwesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
Awesome Traefik - Ingress Controller for Kubernetes - Swapnasagar Pradhan
 
From simple to more advanced: Lessons learned in 13 months with Tableau
From simple to more advanced: Lessons learned in 13 months with TableauFrom simple to more advanced: Lessons learned in 13 months with Tableau
From simple to more advanced: Lessons learned in 13 months with Tableau
 
Noah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku SecretsNoah Zoschke at Waza 2013: Heroku Secrets
Noah Zoschke at Waza 2013: Heroku Secrets
 
Nginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with LuaNginx Scripting - Extending Nginx Functionalities with Lua
Nginx Scripting - Extending Nginx Functionalities with Lua
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scripting
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporation
 
Testing TYPO3 Applications
Testing TYPO3 ApplicationsTesting TYPO3 Applications
Testing TYPO3 Applications
 
Marko Gargenta_Remixing android
Marko Gargenta_Remixing androidMarko Gargenta_Remixing android
Marko Gargenta_Remixing android
 
Create Custom Post Type Plugin
Create Custom Post Type PluginCreate Custom Post Type Plugin
Create Custom Post Type Plugin
 
Theme Development and Customization
Theme Development and CustomizationTheme Development and Customization
Theme Development and Customization
 
Kernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power ManagementKernel Recipes 2015: Introduction to Kernel Power Management
Kernel Recipes 2015: Introduction to Kernel Power Management
 
rpm-building-101.pdf
rpm-building-101.pdfrpm-building-101.pdf
rpm-building-101.pdf
 

More from Nicholas Jansma

Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...Nicholas Jansma
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealNicholas Jansma
 
Reliably Measuring Responsiveness
Reliably Measuring ResponsivenessReliably Measuring Responsiveness
Reliably Measuring ResponsivenessNicholas Jansma
 
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Nicholas Jansma
 
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTimingDebugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTimingNicholas Jansma
 

More from Nicholas Jansma (6)

Modern Metrics (2022)
Modern Metrics (2022)Modern Metrics (2022)
Modern Metrics (2022)
 
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...
 
When Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting RealWhen Third Parties Stop Being Polite... and Start Getting Real
When Third Parties Stop Being Polite... and Start Getting Real
 
Reliably Measuring Responsiveness
Reliably Measuring ResponsivenessReliably Measuring Responsiveness
Reliably Measuring Responsiveness
 
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...
 
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTimingDebugging IE Performance Issues with xperf, ETW and NavigationTiming
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
 

Recently uploaded

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Recently uploaded (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

Using Phing for Fun and Profit

  • 1. USING PHING FOR FUN AND PROFIT PHING: A PHP BUILD SYSTEM Nic Jansma nicj.net @NicJ
  • 2. PHING Phing is a cross-platform PHP build tool, similar to Apache Ant.
  • 3. WHAT IS A BUILD TOOL? A build tool helps you automate repetitive tasks.
  • 4. A BUILD TOOL HELPS YOU... Build resources (CSS, JavaScript, templates, etc) Validate code (lint, sniff, etc) Run unit tests Build documentation Create packages Deploy code Execute system commands ... and anything else you do repetitively ...
  • 5. WHY USE A BUILD TOOL? Otherwise you will f*** up. You should automate everything you can. Automating your processes will save you time. Automating your processes will save you from your future self. Maybe not today, maybe not tomorrow, but at some point you will make a mistake if it's not automated.
  • 6. WHY USE PHING? It's written in PHP, so if the rest of your project is PHP, you can run Phing. Besides PHP, no other external dependencies are needed (such as Ruby or Java). Great community support, with hundreds of different tasks.
  • 7. INSTALLATION - GITHUB github.com/phingofficial/phing $ gt c oe ht s / gt u .o /h no fc a /h n. i > i l n tp : /i hb cm p ig fi il pi g gt $ pp p ig bn pi g > h h n i h n
  • 8. INSTALLATION - PHAR PACKAGE www.phing.info/trac/wiki/Users/Download $ w e h t : / w . h n . n o g t p i g l t s . h r - p i gp a > g t tp /w wp ig i f / e/ hn -a e tp a O hn .h r $ pp p ig pa > h h n. hr
  • 9. INSTALLATION - PEAR $ pa c an ld s oe p a. hn .n o > e r hn e- ic vr e rp i gi f $ pa i sa lp i gp ig > e r nt l hn /h n $ pi g > hn
  • 10. INSTALLATION COMPOSER composer.json: { " eu r" { r q ie : "hn /h n " " . ." pi gp ig : 26 1 } } $ pp c mo e. hr is a l > h o ps rp a n tl L ai gc mo e rp st r e w t pc ae i fr ai n o dn op sr e oi oi s ih a kg n om t o I sa ln d pn ec e (n ld n rq ie d v n tl i g e ed n is i cu ig e ur -e ) -I sa ln p ig pi g (. .) n t li g h n/h n 26 1 D wl ai g 10 o n od n: 0 % W ii gl c fl r tn ok ie G nr tn a tl a fl s e ea i g u oo d ie $ pp v no h n hn i hn > h e dr pi g pi g b np i g
  • 11. PHING OVERVIEW Phing is driven by XML files that define your projects, build targets, and individual tasks. The XML format is very similar to Apache Ant.
  • 12. PHING - PROJECTS A project is the root element of your XML. The < r j c >defines of all of your build targets and the poet tasks that will execute for the targets. Only the d f u tattribut is required, which specifies the eal default target to run. < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "u l" p oe t ae "y p oe t ea l =b id > < - tr es ad ts s -> ! - ag t n a k < - .. -> !- . <po et /rj c >
  • 13. PHING - TARGETS A < a g t is a logical set of actions you want to take. tre> A < a g t can have tasks. tre> A < a g t can also have a list of other targets it depends tre> on. < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "u l" p oe t ae "y p oe t ea l =b id > < ag tn m=b id d pn s" la ,i t mn f"/ t r e ae"u l" e ed = ce nl n, ii y > < ag tn m=c en > t r e ae"l a" <co mg " ' c e nn y u b id / eh s =I m la ig o r ul " > <tr e > /a gt < - .. -> !- . <po et /rj c >
  • 14. PHING - TASKS A task will take an action. Tasks can be a core task that Phing ships with, or an external plug-in that you write. < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "u l" p oe t ae "y p oe t ea l =b id > < ag tn m=c en > t r e ae"l a" <co mg " ' c e nn y u b id / eh s =I m la ig o r ul " > <ee e d r"u l" / dl t i=bi d > <tr e > /a gt <po et /rj c >
  • 15. PHING - CORE TASKS 123 built-in tasks. Some of the most useful: File operations: a p n , c p , d l t , m d r ped oy eee ki Conditional logic: c n i i n f r a h i , f i odto, oec, f al Input / output: e h , i p t co nu System: e e , t t m , t s d f xc sap ake Source control: g t , s n , c s i* v* v* Network: f p e l y h t g t m i , s p t s p s h tdpo, tpe, al 3u, c, s External Libraries: p p o e n f e , p p n t hcdsifr hui, p p o u e t rj l n , p p d hdcmno, sit hm
  • 16. PHING - PROPERTIES A property is a variable. Properties can come from built-in properties (Phing environment variables), a b i d p o e t e file, or ul.rpris created at runtime in your XML file via the < r p r y poet> element. Use properties via the $ p o e t n m }syntax. {rpryae < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "l a" p oe t ae "y p oe t ea l =c en > < rp ry nm = bi di "v l e" /u l" / p o et a e" ul d r au=. bi d > < ag tn m=c en > t r e ae"l a" <co mg " ' c e nn $ bi di } / eh s =I m la ig { ul dr " > <ee e d r"{ ul dr " / dl t i=$b i di } > <tr e > /a gt <po et /rj c >
  • 17. PHING - BUILT-IN PROPERTIES There are many built-in properties: apiainsati,ev* hs.rh plcto.trdr n., otac, hs.oan hs.sye hs.ae hs.s otdmi, otftp, otnm, oto, hs.srlae hs.svrin oto.ees, oto.eso, ln.eaao,o.ae pigfl, iesprtr snm, hn.ie pigdr pighm,pigvrin hn.i, hn.oe hn.eso, pigpoetnm,ppcasah hn.rjc.ae h.lspt, ppvrin poetbsdr ue.oe h.eso, rjc.aei, srhm
  • 18. PHING - .PROPERTIES FILES Simple k y v l eformat e=au #Ti i ac me t i t e .r pr is fl hs s om n n h po e te i e k yv le e =a u b id i= ul u ld r bi d m ap nm =o y p. a ef o m ap ul ht :/ o .o y p. r =t p/ fo cm < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "l a" p o e t a e " y p o e t e a l =c e n > < rp ry fl = .b id po e te "/ p o et i e" /u l .r pr is > < ag tn m= c en > t r e ae "l a" < co mg " ' c e nn $ bi di }f r$ m ap nm } / eh s =I m la ig { ul dr o {y p. a e" > <ee e d r"{ ul dr " / dl t i= $b i di } > < tr e> / a gt < po et / rj c>
  • 19. PHING - < R P R Y POET> Define new properties in your XML. < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "u l" p o e t a e " y p o e t e a l =b i d > < rp ry nm = bi di "v l e" /u l" / p o et a e" ul d r au =. bi d > < rp ry nm = cs i"vl e "{ ul }c s / p o et a e" sd r a u= $b id / s" > < rp ry nm = jd r vl e"{u l} j "/ p o et a e" si " au =$b id /s > < ag tn m= c en > t r e ae "l a" <ee e d r"{ sd r"/ dl t i= $c s i} > <ee e d r"{ si } / dl t i= $j d r" > < tr e> / a gt < po et / rj c>
  • 21. SIMPLE < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "c o > p oe t ae "y p oe t ea l =e h" < ag tn m=e h" t r e ae"c o > <co mg " el "/ eh s =H lo > <tr e > /a gt <po et /rj c > > pi geh $ h n co B id ie . bi dx l u lf l : ul . m m -r jc > eh : y po e t co [ c o H lo eh ] el B ID FN SE U L I IH D T tl tm :0 18 s cn s o a i e .7 0 eo d
  • 22. TWO TASKS < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "i s" p oe t ae "y p oe t ea l =f rt > < ag tn m=f rt d pn s" eo d / t r e ae"i s" e ed = sc n" > < ag tn m=s cn " t r e ae"e od > <al ms a e" o ms e u" / fi e sg =Y u es d p > <tr e > /a gt <po et /rj c > > pi g fr t $ h n is B id ie . bi dx l u lf l: ul . m m -r jc > sc n : y po e t eo d E eu in o tr e "e od f ie f rt ef lo i gr ao : x ct o f ag t sc n " a l d o h ol wn e s n . bi dx l1: 2 Y u ms e u u l. m: 62 : o es d p B ID FI E U L A LD . bi dx l1:2 Y um s e u ul . m: 62 : o es d p T tl tm :0 10 s cn s o a i e .8 0 eo d
  • 23. SHELL COMMANDS < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "e ly > p oe t ae "y p oe t ea l =d po " < rp rynm = dp o. ot a e v le " o. o"/ p o et a e" el y hs nm " au=f oc m > < ag tn m=d po " t r e ae"e ly > <xc ee c ma d"s n -v . $d po . ot ae / om n=ry z az / { el yh sn m }" d r" { rj c. ae i } i= $p oe t bs dr " c ek e un"r e / hc rt r=t u" > <tr e > /a gt <po et /rj c >
  • 24. EXTERNAL PHP < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =m -r jc " df ut "x en l ak > p oe t ae "y p oe t ea l =e tr at s" < ag tn m=e tr at s" t r e ae"x en l ak > <ak e ts df n m=m po et ak ae"y rj c ts " c as a h" {r jc . ae i} ls pt=$ p oe tb sd r" c as a e" ya k / <- .M T s. h -> ls nm=M T s" > !- / ya kp p <yr jc t s m s ae'i / mp oe ta k es g=h ' > <tr e > /a gt <po et /rj c > < pp ?h r qi eo c 'h n/ ak p p; e ur _ ne pi g Ts .h ' c as MT s et ns Ts { l s y ak xe d a k p oe td $e s g; r t ce m sa e / s tf o t e ts ' at iu ei t eX L / e r m h ak s tr b t n h M p bi f nt o st es g (m sa e { u l c u ci n eM s ae $e sg ) $ hs>e s g = $ es g; ti-m sa e m sa e } / e eu e w e ts i c le / x ct d hn a k s a l d p bi f nt o mi ( { u l c u ci n an ) e h $h s> es g ; co ti - ms ae }
  • 25. EXTERNAL PHP - OUTPUT $ pi ge tr at s > hn xe nl ak B id ie . bi d x l u lf l : ul . m [ rp r y L ai g .b id po e te po et ] od n u l .r pr is m -r jc > et ra ts : y po e t xe n la k h i B ID FN SE U L I IH D T tl tm :0 23 s cn s o a i e .9 0 eo d
  • 26. CONTINUOUS INTEGRATION / BUILD SERVER < xl vr in ". " ec dn =U F 8? ? m e so =1 0 no i g" T- "> < rj c nm =b gp oe t df u t" ul " p oe t ae "i - rj c" e al =b id > < - mi tr e s- > ! - an a gt < ag tn m=b id d pn s" la ,h c ot ln , t r e ae"u l" e ed = ce nc ek u, i t s if pp d ts ,o ,a k g" / nf ,h m, et d cp ca e > < ag tn m=d po "d pn s"u l, r- el y ry cr la e / t r e ae"e ly ee d=bi dp e dp o, sn , ee s" > < ag tn m=c en > t r e ae"l a" < - ce nt eb i d- > !- la h ul <tr e > /a gt < ag tn m=c ek u" t r e ae"h co t > < - ce ku / pl l ts f o s u c c n rl -> !- hc o t u l a e t r m or e ot o <tr e > /a gt < ag tn m=l n" dp ns " hl n, si tc s it / t r e ae"i t e ed =p pi tj l n, sl n" > < ag tn m=p pi t> t r e ae"h ln " < - pp ln a l* pp f ls -> !- h i t l .h i e <tr e > /a gt < ag tn m=j ln " t r e ae"s it >
  • 27. DOWNSITDES Learning curve if you're not familiar with Ant. Asynchronous operation, so large builds/deploys may be slow. Not everything is available on all OSs.
  • 28. CONCLUSION 1. Use Phing 2. ??? 3. Profit!
  • 29. CONCLUSION Phing is a great way to automate repetitive tasks. Phing can be as simple or complex (and powerful) as you make it. Phing can save time and reduce human error. More Info: phing.info Jenkins integration Jetbrains PhpStorm integration Eclipse integration Thanks - Nic Jansma - nicj.net - @NicJ