<p>Does anyone use <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a> 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.</p>

<p>I have often thought that maybe we should be using <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a>. I haven't used ant much, so I don't have a real sense of what <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a> 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 <a href="http://phing.info/trac/" rel="nofollow noreferrer">Phing</a> into our process?</p>

[{'answer_id': 36687, 'author': 'Ryan Guest', 'author_id': 1811, 'author_profile': 'https://Stackoverflow.com/users/1811', 'pm_score': 5, 'selected': True, 'text': '<p>From Federico Cargnelutti\'s <a href="http://phpimpact.wordpress.com/2007/06/30/phing-php-project-build-system-based-on-apache-ant/" rel="noreferrer">blog post</a>:</p>\n\n<blockquote>\n  <p>Features include file transformations (e.g. token\n  replacement, XSLT transformation,\n  Smarty template transformations), file\n  system operations, interactive build\n  support, SQL execution, CVS\n  operations, tools for creating PEAR\n  packages, and much more.</p>\n</blockquote>\n\n<p>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.</p>\n'}, {'answer_id': 235259, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>I don\'t see any compelling reason to go with phing. I mean, should PHP programmers attempt a rewrite of Eclipse "just because" it might somehow be easier to write Eclipse plugins in PHP? I don\'t think so.</p>\n\n<p>Ant has better documentation, including some nice o\'reilly books, and it\'s well-established in the Java universe, so you avoid the problems of (1) "we haven\'t copied feature X to phing yet" and (2) the risk of the phing project going dead. <a href="http://nohn.net/blog/view/id/cruisecontrol_ant_and_phpunit" rel="nofollow noreferrer">Here\'s</a> an article on configuring PHPUnit to work with ant and cruisecontrol: not that hard. And you get eclipse integration for free.</p>\n\n<p>Good luck!</p>\n'}, {'answer_id': 790526, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 3, 'selected': False, 'text': "<p>I moved from Ant to Phing 'just because' it's PHP. I use it to export from different subversion repositories, copy stuff around, build different installation packages, etc all of that with a 20 line reusable xml file and a config file with project specific stuff. No way I could do it that fast with a custom script. I also plan to integrate api documentation generation and unit tests. Love it!</p>\n"}, {'answer_id': 967337, 'author': 'user119494', 'author_id': 119494, 'author_profile': 'https://Stackoverflow.com/users/119494', 'pm_score': 3, 'selected': False, 'text': "<p>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.</p>\n"}, {'answer_id': 6323542, 'author': 'cweiske', 'author_id': 282601, 'author_profile': 'https://Stackoverflow.com/users/282601', 'pm_score': 2, 'selected': False, 'text': '<p>We use phing to deploy <a href="http://semanticscuttle.sourceforge.net/" rel="nofollow">SemanticScuttle</a>:</p>\n\n<ul>\n<li>generate zip archive for distribution</li>\n<li>create <a href="http://pear.php.net" rel="nofollow">PEAR</a> package</li>\n<li>upload <a href="http://sourceforge.net/projects/semanticscuttle/files/SemanticScuttle/" rel="nofollow">zip</a> to SourceForge</li>\n<li>update the <a href="http://semanticscuttle.sourceforge.net/pirum.html" rel="nofollow">PEAR channel</a> with the new package file</li>\n<li>render reStructuredText documentation into html files and uploading them. Currently with <code>exec</code> but I\'m on the way writing a <a href="https://gitorious.org/phing/rsttask" rel="nofollow">separate task</a> for it.</li>\n</ul>\n\n<p>Uploading the zip file and the channel is done via rsync, which is unfortunately not supported by phing through a special task - but using <code>exec</code> is always possible and works nicely.</p>\n\n<p>In the end, it saves a lot of time and we\'re able to test, package and deploy our app with one single command (which gives us another point on the <a href="http://www.joelonsoftware.com/articles/fog0000000043.html" rel="nofollow">Joel Test</a>). I would not want to live without it.</p>\n\n<p>See the <a href="http://sourceforge.net/p/semanticscuttle/code/ci/master/tree/build.xml" rel="nofollow">build.xml code</a>.</p>\n'}]
['https://Stackoverflow.com/questions/36646', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/577/']