{"id":28439,"date":"2018-03-19T13:28:31","date_gmt":"2018-03-19T11:28:31","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/?p=28439"},"modified":"2018-03-19T13:28:31","modified_gmt":"2018-03-19T11:28:31","slug":"have-you-tried-composer-scripts-you-do-not-need-phing","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2018\/03\/19\/have-you-tried-composer-scripts-you-do-not-need-phing\/","title":{"rendered":"Have you tried Composer Scripts? You DO not need Phing."},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;<a href=\"https:\/\/blog.martinhujer.cz\/have-you-tried-composer-scripts\/\">Have you tried Composer Scripts? You may not need Phing.<\/a>&#8221; is a nice blog post showing how to use <a href=\"https:\/\/getcomposer.org\/doc\/articles\/scripts.md\">Composer scripts<\/a> to solve simple build and deployment automation.\u00a0 There&#8217;s plenty of good advice in there.<\/p>\n<p>However I have one issue with it.\u00a0 It&#8217;s the &#8220;You may not need Phing.&#8221; part.\u00a0 Irrelevant of your use of Composer scripts, you DON&#8217;T need <a href=\"https:\/\/www.phing.info\/\">Phing<\/a>.\u00a0 Phing had its time.\u00a0 It was one of the first build and deployment tools for PHP and it was better than all the alternatives at the time (manual builds, custom shell scripts, or tools from other programming languages).<\/p>\n<p>Those days are long gone and we have better tools now.\u00a0 If you are still using (or even considering using Phing), I beg you to look another way.\u00a0 Check out <a href=\"https:\/\/deployer.org\/\">Deployer<\/a>.\u00a0 Check out <a href=\"https:\/\/robo.li\/\">Robo.li<\/a>.\u00a0 Check other alternatives.\u00a0 Don&#8217;t use Phing.<\/p>\n<p>What&#8217;s wrong with Phing? Well, I can sum it up in one and one reason only.\u00a0 It&#8217;s XML-based.\u00a0 Yeah, that&#8217;s right.\u00a0 Phing routes come from <a href=\"http:\/\/ant.apache.org\/\">Apache Ant<\/a>, which is a very common build tool for the Java world.\u00a0 And Java world is full of XML.<\/p>\n<p>In the year of 2018, we&#8217;ve figured out better ways.\u00a0 Both JSON and YAML are better alternatives to XML for both humans and machines.\u00a0 JSON and YAML are easier to read and generate.<\/p>\n<p>Furthermore, even XML is not the most appropriate format for what Phing is working with.\u00a0 Sure, as long as you can stick with the basic configuration of existing tasks and options &#8211; it doesn&#8217;t make much difference.\u00a0 But at some point, you&#8217;ll need to extend and customize your build and deployment process.\u00a0 And you&#8217;ll eventually end up writing PHP code using XML syntax.\u00a0 And trust me, there is no fun in that at all.<\/p>\n<p>Use PHP to write PHP code.\u00a0 Use PHP tools for your PHP projects.\u00a0 We have these now and they are great.\u00a0 At <a href=\"https:\/\/qobo.biz\/\">work<\/a> we are using <a href=\"https:\/\/robo.li\/\">Robo.li<\/a> very extensively and it works amazing!\u00a0 You don&#8217;t have to use it.\u00a0 Pick whatever works for you.\u00a0 But if Phing works for you, you&#8217;re probably doing something wrong.<\/p>\n<p>Oh, and yes, <a href=\"https:\/\/getcomposer.org\/doc\/articles\/scripts.md\">Composer scripts<\/a> are awesome too.\u00a0 Try them out, if you haven&#8217;t already.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>&#8220;Have you tried Composer Scripts? You may not need Phing.&#8221; is a nice blog post showing how to use Composer scripts to solve simple build and deployment automation.\u00a0 There&#8217;s plenty of good advice in there. However I have one issue with it.\u00a0 It&#8217;s the &#8220;You may not need Phing.&#8221; part.\u00a0 Irrelevant of your use of &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2018\/03\/19\/have-you-tried-composer-scripts-you-do-not-need-phing\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Have you tried Composer Scripts? You DO not need Phing.<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Have you tried Composer Scripts? You DO not need Phing. #WebDev #PHP #composer #DevOps","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18,62,1334],"tags":[3489,1586,3133,38,1330],"keyring_services":[],"class_list":["post-28439","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","category-technology","category-web-work","tag-composer","tag-deployment","tag-phing","tag-php","tag-web-development"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":21770,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/05\/08\/phingistrano-php-software-build-and-deployment-utility-using-phing\/","url_meta":{"origin":28439,"position":0},"title":"Phingistrano &#8211; PHP software build and deployment utility using phing","author":"Leonid Mamchenkov","date":"May 8, 2014","format":"link","excerpt":"Phingistrano - PHP software build and deployment utility using phing","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":16933,"url":"https:\/\/mamchenkov.net\/wordpress\/2012\/11\/22\/phing-fatal-error-after-upgrade-to-2-4-13\/","url_meta":{"origin":28439,"position":1},"title":"phing fatal error after upgrade to 2.4.13","author":"Leonid Mamchenkov","date":"November 22, 2012","format":false,"excerpt":"If you are using phing for building and deploying projects (and you should), and using Remi repository for PHP 5.3 and related tools for CentOs and RedHat, be prepared to see a problem with phing and build.xml files that use conditions in If. \u00a0 Here is a sample snippet from\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":22402,"url":"https:\/\/mamchenkov.net\/wordpress\/2014\/08\/19\/phake-php-task-management-software\/","url_meta":{"origin":28439,"position":2},"title":"Phake &#8211; PHP task management software","author":"Leonid Mamchenkov","date":"August 19, 2014","format":"link","excerpt":"Phake - PHP task management software. \u00a0This Phake is a clone of Ruby's rake, not to be confused with Phake - PHP Mocking Framework. \u00a0Think Phing, not PHPUnit. \u00a0Use Phake for process automation such as, for example, project deployment.","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11936,"url":"https:\/\/mamchenkov.net\/wordpress\/2009\/11\/19\/day-in-brief\/","url_meta":{"origin":28439,"position":3},"title":"Day in brief","author":"Leonid Mamchenkov","date":"November 19, 2009","format":false,"excerpt":"Woke up with no hangover what so ever. That is very suspicious. Upgraded to Fedora 12. Now for breakfast and more talks. #ipc09 # Stress-free deployment talk for me to kick off the last day of #ipc09 # Automatic deployment of database scheme changes. Tools: dbdeploy, LiquiBase, Doctrine. #ipc09 #\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26912,"url":"https:\/\/mamchenkov.net\/wordpress\/2016\/11\/20\/robo-modern-task-runner-for-php\/","url_meta":{"origin":28439,"position":4},"title":"Robo &#8211; Modern Task Runner for PHP","author":"Leonid Mamchenkov","date":"November 20, 2016","format":false,"excerpt":"There is a whole lot of ways to build and deploy web applications these days. \u00a0I've done my own circle of trials and errors and have some very strong opinions on which ones are good, which ones are bad, and which ones are ugly. My most recent discovery was Robo\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"robo","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2016\/11\/robo-500x239.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":18442,"url":"https:\/\/mamchenkov.net\/wordpress\/2013\/07\/03\/github-adds-releases\/","url_meta":{"origin":28439,"position":5},"title":"GitHub adds Releases","author":"Leonid Mamchenkov","date":"July 3, 2013","format":false,"excerpt":"By now you know that I can't praise GitHub enough. \u00a0It is one of the best tools for developers ever. \u00a0Seriously. \u00a0It's up there with git itself, and even Vim. \u00a0If you aren't using it yet, stop whatever it is you are doing and rush there. \u00a0Now. I'm not kidding.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"GitHub releases","src":"https:\/\/i0.wp.com\/mamchenkov.net\/wordpress\/wp-content\/uploads\/2013\/07\/GitHub-releases-500x254.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=28439"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/28439\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=28439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=28439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=28439"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=28439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}