Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you use Phing? [closed]

Tags:

Does anyone use Phing to deploy PHP applications, and if so how do you use it? We currently have a hand-written "setup" script that we run whenever we deploy a new instance of our project. We just check out from SVN and run it. It sets some basic configuration variables, installs or reloads the database, and generates a v-host for the site instance.

I have often thought that maybe we should be using Phing. I haven't used ant much, so I don't have a real sense of what Phing is supposed to do other than script the copying of files from one place to another much as our setup script does. What are some more advanced uses that you can give examples of to help me understand why we would or would not want to integrate Phing into our process?

like image 916
Sam McAfee Avatar asked Aug 31 '08 05:08

Sam McAfee


People also ask

What Phing?

Phing is a PHP tool that allows us to automate processes -- typically, it's used for building and deploying software. It's similar in functionality to the Apache Ant project and uses XML files to execute tasks that are defined as PHP classes.

What is the build tool for PHP?

Phing is 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 "task" classes make it an easy-to-use and highly flexible build framework.

Are Thai national parks open?

Bangkok, 19 August, 2021 – The Tourism Authority of Thailand (TAT) would like to announce that the Department of National Parks, Wildlife and Plant Conservation (DNP) has reopened 60 of its 155 national parks nationwide starting from this month until further notice.

Is Khao Yai open for tourists?

The park is open 6 am to 6 pm everyday all year round, vehicles already inside the park can leave on late hours. As of June 2022, the entrance fees for Khao Yai National Park are 200 Baht for adults and 100 Baht for children 3-14 years old.


2 Answers

From Federico Cargnelutti's blog post:

Features include file transformations (e.g. token replacement, XSLT transformation, Smarty template transformations), file system operations, interactive build support, SQL execution, CVS operations, tools for creating PEAR packages, and much more.

Of course you could write custom scripts for all of the above. However, using a specialized build tool like Phing gives you a number of benefits. You'll be using a proven framework so instead of having to worry about setting up "infrastructure" you can focus on the code you need to write. Using Phing will also make it easier for when new members join your team, they'll be able to understand what is going on if they've used Phing (or Ant, which is what Phing is based on) before.

like image 132
Ryan Guest Avatar answered Oct 20 '22 04:10

Ryan Guest


The compelling answer for me is that phing understands PHP classpaths. Ant doesn't. I don't want to have an ant build.xml full of exec commands. I happen to be primarily a java programmer and still use phing. It's the best tool for the job.

like image 31
user119494 Avatar answered Oct 20 '22 04:10

user119494