SlideShare una empresa de Scribd logo
1 de 33
Descargar para leer sin conexión
Putting "Phings" together - how to automate
your life
Table of contents
•
•
•
•
•
•
•
•

About me
Introduction to Phing
Basics
What Phing can do for you
Phing and Drupal
How Phing is helping us/Demo
Conclusions
Q/A
About me
• Boyan Borisov
• Team Leader @
Propeople
• boyanb@propeople.dk
• @boyan_borisov
• Skype: boian.borisov
• http://linkedin.com/in/
boyanborisov
What is Phing?
• (PH)ing (I)s (N)ot (G)NU make
• Project build tool
• Platform-independent: works
on UNIX, Windows, Mac OSX
• Based on Apache Ant
• Provides a simple OO model
for extending
• Uses XML build files
• No required external
dependencies
• Open source – written on
PHP5
Why?
• Improves work quality
• Eliminates repeatable
tasks
• Minimises errors
• Saves time and money
• More code, less
configuration
• Forces universal way of
automation
• Tons of built-in tasks and
features
Let’s install it
• Pear install
$> pear channel-discover pear.phing.info
$> pear install [--alldeps] phing/phing
• Non pear install
$> apt-get install pear
$> pear channel-discover pear.phing.info
$> pear install [--alldeps] phing/phing
Using Phing
•
•
•
•
•
•
•
•

phing -v
phing -f mybuildfile.xml
phing -f mybuildfile.xml mytarget
phing
phing mytarget
phing -l
phing -debug
phing -Dproperty.name=value
Basics
•
•
•
•
•
•

Build.xml
Project
Target
Task
Properties
Built-In Properties
Build.xml
<project name="example" default="hello">
<target name="hello" >
<echo>Hello world!</echo>
</target>
<target name= "bye">
<echo>Bye!</echo>
</target>
</project>
Project
<project name="example" default="world”
description="Phing example">
<target name="world" description="Say world"
depends="hello">
<echo>world!</echo>
</target>
<target name="hello" description="Say hello">
<echo>Hello</echo>
</target>
</project>
Target
<project name="example" default="world”
description="Phing example">
<target name="world" description="Say world"
depends="hello">
<echo>world!</echo>
</target>
<target name="hello" description="Say hello">
<echo>Hello</echo>
</target>
</project>
Task
<project name="example" default="world”
description="Phing example">
<target name="world" description="Say world"
depends="hello">
<echo>world!</echo>
</target>
<target name="hello" description="Say hello">
<echo>Hello</echo>
</target>
</project>
Properties
• Built-in properties
• Custom properties
• Declaration
– Inline
– External file
– Input
Properties
<project name="Example" default="default">
<property name="var1" value="value1"/>
<property file="build.properties"/>
<input propertyName="var3">Enter var3</input>
<target name="default">
<echo>Variables: ${var1}, ${var2} and
${var3}</echo>
</target>
</project>
Build properties file
Drupal.site_name = “Test site”
Drupal.profile = “standard”
#comment
Project.env = “dev”
Project.git.url = “httpp://…”
Tasks
• Core: – Copy, Delete, Echo, Exec, Move,
Foreach, PhpEvalTask and more
• Optional: – FtpDeploy, GitPush, PDOSQL Exec,
Scp, Zip, and more
FileSet
<fileset dir="./application" includes="**" />
<fileset dir="./application" id="files">
<include name="**/*.php"/>
<exclude name="**/*Test.php"/>
</fileset>
<fileset refid="files" />
FileSet selectors
<fileset dir="${dist}">
<and>
<filename name="**/*.log"/>
<date datetime="01/01/2013"
when="before"/>
</and>
</fileset>
Mappers
• Mappers are like filters for files and directories
– Flatten
– Glob
– RegExp

<mapper type="mappername"
from="frompattern" to="topattern" />
FlattenMapper
<copy todir="/tmp">
<mapper type="flatten" />
<fileset refid="someid" />
</copy>
GlobMapper
<copy todir="/tmp">
<mapper type="glob" from="*.php"
to="*.php.bak"/>
<fileset refid="someid"/>
</copy>
RegexpMapper
<mapper type="regexp"
from="^(.*).conf.xml" to="1.php"/>
Filters
• Filters Transform data/file contents within a
task
– Tidy
– ExpandProperty
– StripPhpComments
– ReplaceRegexp
– StripWhitespace
TidyFilter
<filterchain>
<tidyfilter encoding="utf8">
<config name="indent" value="true" />
<config name="output-xhtml" value="true"
/>
</tidyfilter>
</filterchain>
ExpandProperty
<target name="config">
<property name="config.template" value="config.php-dist" />
<property name="config.file" value="config.php" />
<property file="config.properties" override="true" />
<copy file="${config.template}" tofile="${config.file}">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</target>
Extending Phing
•
•
•
•
•
•

Tasks
Types
Selectors
Filters
Mappers
Loggers ...
Sample task
SampleTask extends Task {
private $var;
public function setVar($v) {
$this->var = $v;
}
public function main() {
print('value: ' . $this->var);
}

}
Hey, is this a DrupalCamp or what?!
Phing Drush Task
https://drupal.org/project/phingdrushtask
drush site-install --yes --locale=uk --site-name
=${sitename} expert
<drush command="site-install" assume="yes"">
<option name="locale">uk</option>
<option name="site-name" value="${sitename}"/>
<param>expert</param>
</drush>
How Phing is helping us
• Company is growing – from 30 to 75+ people
in about a year
• Bigger projects – from 300 to 2000+ hours
• Bigger teams – from 2 to 10+ team members
• Many new employees
• Many developers, many ways to manage a
project
Thank you, Phing!
What’s next
• http://phing.info
• Adopt Phing for your
needs
• Create new tasks
• Contribute
• Jenkins
• https://github.com/relo
ad/phing-drupaltemplate
Questions?

Más contenido relacionado

La actualidad más candente

Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Laura Scott
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in GoSteven Francia
 
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Marcel Chastain
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingRobert Carr
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance DrupalJeff Geerling
 
5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5Dylan Jay
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateLaura Scott
 
Save 15 Minutes or More on WordPress
Save 15 Minutes or More on WordPressSave 15 Minutes or More on WordPress
Save 15 Minutes or More on WordPressAlex Centeno
 
Beyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighBeyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighGlenn Ansley
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentCss Founder
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Themecertainstrings
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Michael Pirnat
 
EscConf - Deep Dive Frontend Optimization
EscConf - Deep Dive Frontend OptimizationEscConf - Deep Dive Frontend Optimization
EscConf - Deep Dive Frontend OptimizationJonathan Klein
 
Realtime Apps with Django
Realtime Apps with DjangoRealtime Apps with Django
Realtime Apps with DjangoRenyi Khor
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme SystemPeter Arato
 

La actualidad más candente (20)

Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
Grok Drupal (7) Theming (presented at DrupalCon San Francisco)
 
Building Awesome CLI apps in Go
Building Awesome CLI apps in GoBuilding Awesome CLI apps in Go
Building Awesome CLI apps in Go
 
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...Get Django, Get Hired - An opinionated guide to getting the best job, for the...
Get Django, Get Hired - An opinionated guide to getting the best job, for the...
 
A look at Drupal 7 Theming
A look at Drupal 7 ThemingA look at Drupal 7 Theming
A look at Drupal 7 Theming
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
Introduction to Drupal (7) Theming
Introduction to Drupal (7) ThemingIntroduction to Drupal (7) Theming
Introduction to Drupal (7) Theming
 
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
 
5 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 55 things STILL! TOO! HARD! in Plone 5
5 things STILL! TOO! HARD! in Plone 5
 
Grok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb updateGrok Drupal (7) Theming - 2011 Feb update
Grok Drupal (7) Theming - 2011 Feb update
 
Save 15 Minutes or More on WordPress
Save 15 Minutes or More on WordPressSave 15 Minutes or More on WordPress
Save 15 Minutes or More on WordPress
 
Beyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleighBeyond WP-CONTENT | #WCRaleigh
Beyond WP-CONTENT | #WCRaleigh
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopment
 
Builing a WordPress Theme
Builing a WordPress ThemeBuiling a WordPress Theme
Builing a WordPress Theme
 
Domino testing presentation
Domino testing presentationDomino testing presentation
Domino testing presentation
 
Automation in Drupal
Automation in DrupalAutomation in Drupal
Automation in Drupal
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
 
EscConf - Deep Dive Frontend Optimization
EscConf - Deep Dive Frontend OptimizationEscConf - Deep Dive Frontend Optimization
EscConf - Deep Dive Frontend Optimization
 
Realtime Apps with Django
Realtime Apps with DjangoRealtime Apps with Django
Realtime Apps with Django
 
Drupal 7 Theme System
Drupal 7 Theme SystemDrupal 7 Theme System
Drupal 7 Theme System
 

Destacado

Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Boyan Borisov
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesBoyan Borisov
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Taller Negócio Digitais
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsJohn Smith
 
Drupal in the Enterprise, IBM and Norwegian Cruise Line
Drupal in the Enterprise, IBM and Norwegian Cruise LineDrupal in the Enterprise, IBM and Norwegian Cruise Line
Drupal in the Enterprise, IBM and Norwegian Cruise LineRob Shea
 
Tuning Drupal for Scale and Performance
Tuning Drupal for Scale and PerformanceTuning Drupal for Scale and Performance
Tuning Drupal for Scale and PerformanceAdam Kalsey
 
Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibilityhernanibf
 
Scale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanScale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanDoug Hoffman
 
What is Drupal - For Content Editors
What is Drupal - For Content EditorsWhat is Drupal - For Content Editors
What is Drupal - For Content EditorsWeb Explorations
 
Enterprise Drupal Migrations: Lessons From Large-Scale Migrations
Enterprise Drupal Migrations: Lessons From Large-Scale MigrationsEnterprise Drupal Migrations: Lessons From Large-Scale Migrations
Enterprise Drupal Migrations: Lessons From Large-Scale MigrationsPhase2
 
Managing Content in Drupal with Workbench
Managing Content in Drupal with WorkbenchManaging Content in Drupal with Workbench
Managing Content in Drupal with WorkbenchAcquia
 
Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Boyan Borisov
 
Drupal Caching For Dummies
Drupal Caching For DummiesDrupal Caching For Dummies
Drupal Caching For DummiesGokul Nk
 
Supersize me: Making Drupal go large
Supersize me: Making Drupal go largeSupersize me: Making Drupal go large
Supersize me: Making Drupal go largeTom Phethean
 
Phase2 - Large Drupal Multisites (GTA Case Study)
Phase2 - Large Drupal Multisites (GTA Case Study)Phase2 - Large Drupal Multisites (GTA Case Study)
Phase2 - Large Drupal Multisites (GTA Case Study)Robert Bates
 
Designing enterprise drupal
Designing enterprise drupalDesigning enterprise drupal
Designing enterprise drupalJason Burnett
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentNuvole
 
Scaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudScaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudVladimir Ilic
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Gitdirtytactics
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalPhilip Norton
 

Destacado (20)

Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the Scenes
 
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
Best practices for Continuous Deployment with Drupal - DrupalCon Latin Améric...
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The Basics
 
Drupal in the Enterprise, IBM and Norwegian Cruise Line
Drupal in the Enterprise, IBM and Norwegian Cruise LineDrupal in the Enterprise, IBM and Norwegian Cruise Line
Drupal in the Enterprise, IBM and Norwegian Cruise Line
 
Tuning Drupal for Scale and Performance
Tuning Drupal for Scale and PerformanceTuning Drupal for Scale and Performance
Tuning Drupal for Scale and Performance
 
Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibility
 
Scale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. HoffmanScale Conference "Intro to Drupal" Douglas C. Hoffman
Scale Conference "Intro to Drupal" Douglas C. Hoffman
 
What is Drupal - For Content Editors
What is Drupal - For Content EditorsWhat is Drupal - For Content Editors
What is Drupal - For Content Editors
 
Enterprise Drupal Migrations: Lessons From Large-Scale Migrations
Enterprise Drupal Migrations: Lessons From Large-Scale MigrationsEnterprise Drupal Migrations: Lessons From Large-Scale Migrations
Enterprise Drupal Migrations: Lessons From Large-Scale Migrations
 
Managing Content in Drupal with Workbench
Managing Content in Drupal with WorkbenchManaging Content in Drupal with Workbench
Managing Content in Drupal with Workbench
 
Better editorial experience in Drupal 7
Better editorial experience in Drupal 7Better editorial experience in Drupal 7
Better editorial experience in Drupal 7
 
Drupal Caching For Dummies
Drupal Caching For DummiesDrupal Caching For Dummies
Drupal Caching For Dummies
 
Supersize me: Making Drupal go large
Supersize me: Making Drupal go largeSupersize me: Making Drupal go large
Supersize me: Making Drupal go large
 
Phase2 - Large Drupal Multisites (GTA Case Study)
Phase2 - Large Drupal Multisites (GTA Case Study)Phase2 - Large Drupal Multisites (GTA Case Study)
Phase2 - Large Drupal Multisites (GTA Case Study)
 
Designing enterprise drupal
Designing enterprise drupalDesigning enterprise drupal
Designing enterprise drupal
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Scaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloudScaling drupal horizontally and in cloud
Scaling drupal horizontally and in cloud
 
Building a Drupal site with Git
Building a Drupal site with GitBuilding a Drupal site with Git
Building a Drupal site with Git
 
Getting Started With Jenkins And Drupal
Getting Started With Jenkins And DrupalGetting Started With Jenkins And Drupal
Getting Started With Jenkins And Drupal
 

Similar a Putting "Phings" together - how to automate your life

Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with PhingMichiel Rook
 
Building and Deploying PHP apps with Phing
Building and Deploying PHP apps with PhingBuilding and Deploying PHP apps with Phing
Building and Deploying PHP apps with PhingMichiel Rook
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程jeffz
 
Automation with phing
Automation with phingAutomation with phing
Automation with phingJoey Rivera
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Mandi Walls
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application DeploymentMathew Byrne
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
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
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionStefan Schmidt
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Lucidworks
 
OWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonOWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonSimon Bennetts
 
Branding office 365 with front end tooling
Branding office 365 with front end toolingBranding office 365 with front end tooling
Branding office 365 with front end toolingThomas Daly
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...Eric Overfield
 
Resumable File Upload API using GridFS and TUS
Resumable File Upload API using GridFS and TUSResumable File Upload API using GridFS and TUS
Resumable File Upload API using GridFS and TUSkhangtoh
 
Django Overview
Django OverviewDjango Overview
Django OverviewBrian Tol
 

Similar a Putting "Phings" together - how to automate your life (20)

Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
 
Building and Deploying PHP apps with Phing
Building and Deploying PHP apps with PhingBuilding and Deploying PHP apps with Phing
Building and Deploying PHP apps with Phing
 
Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程Documentation Insight技术架构与开发历程
Documentation Insight技术架构与开发历程
 
Automation with phing
Automation with phingAutomation with phing
Automation with phing
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
Automating Web Application Deployment
Automating Web Application DeploymentAutomating Web Application Deployment
Automating Web Application Deployment
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Php task runners
Php task runnersPhp task runners
Php task runners
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
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...
 
Spring Roo Add-On Development & Distribution
Spring Roo Add-On Development & DistributionSpring Roo Add-On Development & Distribution
Spring Roo Add-On Development & Distribution
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
Django
DjangoDjango
Django
 
PHP Profiling/performance
PHP Profiling/performancePHP Profiling/performance
PHP Profiling/performance
 
OWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonOWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP Hackathon
 
Branding office 365 with front end tooling
Branding office 365 with front end toolingBranding office 365 with front end tooling
Branding office 365 with front end tooling
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
All You Need to Know for Automated SharePoint Site Provisioning with PnP Powe...
 
Resumable File Upload API using GridFS and TUS
Resumable File Upload API using GridFS and TUSResumable File Upload API using GridFS and TUS
Resumable File Upload API using GridFS and TUS
 
Django Overview
Django OverviewDjango Overview
Django Overview
 

Último

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...DianaGray10
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 

Último (20)

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
Connector Corner: Extending LLM automation use cases with UiPath GenAI connec...
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 

Putting "Phings" together - how to automate your life

Notas del editor

  1. (PH)ing (I)s (N)ot (G)NU make; it&apos;s a PHP project build system or build tool based on Apache Ant. You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP &quot;task&quot; classes make it an easy-to-use and highly flexible build framework.Phing is a PHP tool that allows us to automate processes -- typically, it&apos;s used for building and deploying software. It&apos;s similar in functionality to the Apache Ant project and uses XML files to execute tasks that are defined as PHP classes. Best of all, it has a tonne of cool tasks already baked in! These include tasty things such as unit testing, file system operations, code sniffer integration, SQL execution, shell commands, 3rd party services and version control integration.Have you heard about Phing before?Is there java developers?
  2. If you find yourself writing custom scripts to handle the packaging, deploying, or testing of your applications, then we suggest looking at Phing. Phing comes packaged with numerous out-of-the-box operation modules (tasks), and an easy-to-use OO model to extend or add your own custom tasks.
  3. Phing uses XML buildfiles that contain a description of the things to do. The buildfile is structured into targets that contain the actual commands to perform (e.g. commands to copy a file, delete a directory, perform a DB query, etc.). So, to use Phing, you would first write your buildfile and then you would run phing, specifying the target in your buildfile that you want to execute. % phing -f mybuildfile.xml mytarget By default Phing will look for a buildfile named build.xml (so you don&apos;t have to specify the buildfile name unless it is not build.xml) and if no target is specified Phing will try to execute the default target, as specified in the &lt;project&gt; tag.
  4. Project – Root node of a build file containing one or more targets.Target – A group of tasks that run as an entity.Task – Custom piece of code to perform a specific function.Properties – Properties (Variables) help to customize execution.Built-In Properties – e.g. host.os, line.separator, phing.version, php.version, …
  5. All Phing really needs at the project level is a build file.  Normally, you will want to name this file  build.xml .  This is the default file name that Phing will look for, so in most cases, this is your best bet.  I am kind of psychotic about what files are in the project root, so normally I but the file in a directory called build, but you can absolutely keep it in the root if you wish. From there it is all about customizing the content of the build file to work with your project.
  6. The outermost tag is the project tag and all of the other tags like targets will be contained within it.  I set my project tags up with a name and description, mostly so I can remember better what I am working on later and to be able to see what the project is supposed to do when I run phing -l.  The other property in this tag are “default” and “basedir”.  Default is the name of the target (which I will explain shortly) that phing will run if none is provided, and basedir is the base directory of the project, relative to the location of the build file.  Since my build file is in the “build” directory, my basedir is one level up.
  7. Target is a group of tasks that run as an entity.
  8. Task is a custom piece of code to perform a specific function.We will cover some of the latter.
  9. Properties (Variables) help to customize execution.
  10. Mappers are applied to the filenames. &lt;mapper type=&quot;mappername&quot; from=&quot;frompattern&quot; to=&quot;topattern&quot; /&gt;Type - Type of the mapper.From - The pattern the filename is to be matched to. The exact meaning is dependent on the implementation of the mapper.To - The pattern according to which the filename is to be changed to. Here, the usage is dependent on the implementation of the mapper, too.
  11. The FlattenMapper removes the directories from a filename and solely returns the filename. This code will copy all files in the fileset to /tmp. All files will be in the target directory.
  12. The GlobMapper works like the copy command in DOSThis will change the extension of all files matching the pattern *.php to .php.bak.
  13. The RegexpMapper changes filenames according to a pattern defined by a regular expression. This is the most powerful mapper and you should be able to use it for every possible application.
  14. Filters are a subset of Phing data types which provide for the transformation of file contents during the operation of another task. For example, a filter might replace tokens in a file as part of a copy task. Filters have to be defined within a &lt;filterchain&gt; context to work.
  15. The TidyFilter allows you to use the PHP tidy extension to clean up and repair HTML documents.
  16. The ExpandProperties simply replaces property names with their property values.what we dofirst we define paths to the template file, the new file and the file containing the propertiesthen we copy the template to the new file and say phing to replace all properties with their valueTemplate fileA template file can be anything and all properties will be replaced by their value
  17. Phing was designed to be flexible and easily extensible. Phing&apos;s existing core and optional tasks do provide a great deal of flexibility in processing files, performing database actions, and even getting user feedback during a build process. In some cases, however, the existing tasks just won&apos;t suffice and because of Phing&apos;s open, modular architecture adding exactly the functionality you need is often quite trivial.