{"id":424,"date":"2012-07-23T08:05:25","date_gmt":"2012-07-23T07:05:25","guid":{"rendered":"http:\/\/blogs.kent.ac.uk\/webdev\/?p=424"},"modified":"2012-08-03T10:46:39","modified_gmt":"2012-08-03T09:46:39","slug":"composer-for-php-packages","status":"publish","type":"post","link":"https:\/\/blogs.kent.ac.uk\/webdev\/2012\/07\/23\/composer-for-php-packages\/","title":{"rendered":"Composer for PHP packages"},"content":{"rendered":"<p><a href=\"http:\/\/getcomposer.org\/\">Composer<\/a> is a great way of installing tools into your app without the old <a href=\"http:\/\/pear.php.net\/\">PEAR<\/a> hassle of installing something on your own laptop, and then having to make sure all the other developers in your team have the same stuff installed. Bah!<\/p>\n<p>So with Composer you just download and install it in your project, and then set up a <code>composer.json<\/code> dependency file which lists the packages the project needs plus bits of configuration. Something like:<\/p>\n<pre class=\"brush: js\">{\r\n\u201crequire\u201d: {\r\n\u201cbehat\/behat\u201d: \u201c2.4@stable\u201d\r\n},\r\n\"config\": { \"bin-dir\": \"bin\/\" }\r\n}<\/pre>\n<p>Then you just run the composer install script:<\/p>\n<p><code>php composer.phar install<\/code><\/p>\n<p>and it will download and install the relevant stuff into your project\u2019s <code>\/vendor<\/code> folder.<\/p>\n<p>That\u2019s it.<\/p>\n<p>If you want a list of packages that are supported by composer then take a look at <a href=\"http:\/\/packagist.org\/\">packagist<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Composer is a great way of installing tools into your app without the old PEAR hassle of installing something on your own laptop, and then &hellip; <a href=\"https:\/\/blogs.kent.ac.uk\/webdev\/2012\/07\/23\/composer-for-php-packages\/\">Read&nbsp;more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1464],"tags":[17081,83,17082,17083,707],"_links":{"self":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/424"}],"collection":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/comments?post=424"}],"version-history":[{"count":6,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/424\/revisions"}],"predecessor-version":[{"id":448,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/posts\/424\/revisions\/448"}],"wp:attachment":[{"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/media?parent=424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/categories?post=424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.kent.ac.uk\/webdev\/wp-json\/wp\/v2\/tags?post=424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}