{"id":159067,"date":"2016-09-14T17:00:00","date_gmt":"2016-09-14T17:00:00","guid":{"rendered":"https:\/\/premium.wpmudev.org\/blog\/?p=159067"},"modified":"2016-09-14T23:13:28","modified_gmt":"2016-09-14T23:13:28","slug":"composer-repository","status":"publish","type":"post","link":"https:\/\/wpmu-dev.pro\/blog\/composer-repository\/","title":{"rendered":"Announcing Composer Support for WPMU DEV Products"},"content":{"rendered":"<p>Automating WordPress installs and test builds is now even easier for developers with WPMU DEV\u2019s new <a href=\"https:\/\/getcomposer.org\/\" target=\"_blank\">Composer<\/a> repository.<\/p>\n<p>Composer, a command line dependency management tool for PHP, has been quickly gaining popularity. Basically, if you like to automate your builds, deploys or\u00a0updates via tools like Git, Capistrano, or Roots.io\/Bedrock, then Composer makes it simple to support WPMU DEV products.<\/p>\n<p>It also gives you fine-grained control over plugin\/theme updates, like auto-updating only to minor bug\/security releases, while skipping\u00a0major feature releases that might require manual configuration.<\/p>\n<h3>What is Composer?<\/h3>\n<p>I quite like how developer Josh Pollock <a href=\"http:\/\/torquemag.io\/2014\/09\/improving-wordpress-development-workflow-composer\/\" target=\"_blank\">describes dependency managers<\/a>:<\/p>\n<blockquote><p>A dependency manager is one of those magical tools, like a smartphone, that most people (myself included) didn\u2019t know they needed until they tried it, but once they did, they were hooked.<\/p><\/blockquote>\n<p>But what does that mean in non-developer speak?<\/p>\n<p>Basically, any code you write often ends up depending on third party libraries. All of these libraries (projects, frameworks, files etc) become dependencies of your project. Composer lets you declare the dependencies for a project and it will install and manage them for you.<\/p>\n<h3>How to Use Composer with WPMU DEV<\/h3>\n<p>Let\u2019s take a look at how it works.<\/p>\n<p>All packages are protected by basic authentication with your WPMU DEV API Key as the username. You can leave the password field blank.<\/p>\n<p>All you need to do is add <em>https:\/\/wpmu-dev.pro\/<\/em> as a Composer repository to your WordPress root <em>composer.json<\/em> file.<\/p>\n<p>Here is an example of what you would need to add to your Composer.json file to install the latest version of our Spirit starter theme and MarketPress plugin:<\/p>\n<div class=\"gist\" data-gist=\"6d64518e701cdb6ef043e6866ebe3e54\" data-gist-file=\"wpmu-dev-composer-support-example\"><a class=\"loading\" href=\"https:\/\/gist.github.com\/6d64518e701cdb6ef043e6866ebe3e54.js?file=wpmu-dev-composer-support-example\">Loading gist 6d64518e701cdb6ef043e6866ebe3e54<\/a><div class=\"gist-consent-notice\" style=\"display:none\"><p>Please <a href=\"javascript:Cookiebot.renew()\">update your cookie preferences<\/a> to enable preference cookies to view this gist.<\/p><\/div><\/div>\n<p>Here is a little example of calling &#8220;composer update&#8221; after adding our repository and some packages:<\/p>\n<figure class=\"wp-caption aligncenter\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"attachment-1364x1364 size-1364x1364\" src=\"https:\/\/wpmu-dev.pro\/blog\/wp-content\/uploads\/2016\/09\/composer-test_\u2014_vagrant_vvv__etc_nginx_custom-sites.png\" alt=\"Calling a Composer update.\" width=\"831\" height=\"341\" \/><figcaption class=\"wp-caption-text\">Calling a Composer update.<\/figcaption><\/figure>\n<p>After entering your API Key, Composer will prompt you to save it in a private location.<\/p>\n<p>There is also some basic dependency management. For example, adding the\u00a0<code>wpmudev\/luke-sara<\/code> theme will automatically install the required <code>wpmudev\/upfront<\/code> parent theme, or one of our buddyPress plugins will require <code>buddypress\/buddypress<\/code> package.<\/p>\n<p>Note: We highly recommended that you don\u2019t save your API Key into Composer.json as this file is often published and publicly accessible, which is a violation of our <a href=\"https:\/\/wpmu-dev.pro\/terms-of-service\/\" target=\"_blank\">Terms of Service<\/a>. So if you save it, make sure it&#8217;s in the proper <em>auth.json<\/em> file, which is excluded from public repositories.<\/p>\n<p>Package names for each\u00a0project can\u00a0found in our <a href=\"https:\/\/wpmu-dev.pro\/projects\/category\/plugins\/\" target=\"_blank\">plugin<\/a> and <a href=\"https:\/\/wpmu-dev.pro\/projects\/category\/themes\/\" target=\"_blank\">theme<\/a> listings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-670x670 aligncenter\" src=\"https:\/\/wpmu-dev.pro\/blog\/wp-content\/uploads\/2016\/09\/install-with-composer.png\" alt=\"Make sure you use the correct package names when installing products via Composer.\" width=\"670\" height=\"430\" \/><\/p>\n<p>Make sure you use the correct package names when installing products via Composer.It\u2019s important to note that this feature is not available to members on our 14-day trial. So if you\u2019re keen to take advantage of our Composer support but still on trial, you can either wait out your trial or upgrade to get started with Composer right away.<\/p>\n<p>The full details of our Composer support is available in our <a href=\"https:\/\/wpmu-dev.pro\/manuals\/using-wpmu-dev\/composer\/\" target=\"_blank\">Manuals<\/a> (which we&#8217;ve redesigned and will be updating soon so keep an eye out!).<\/p>\n<h3>Helping Members Make the Most of WordPress<\/h3>\n<p>This new feature came about after some\u00a0members requested it in our member forums. It was a no-brainer for our CTO Aaron Edwards, who put the repository together in collaboration with members who helped test the new feature.<\/p>\n<p>Our forums are always buzzing with discussions on everything from code and customizations to SEO and online strategy. It&#8217;s a great place to chat to like-minded folks who are also building websites and business, as well as the friendly folks on our support team.<\/p>\n<p>If you&#8217;re already a member, stop by and chat! (and accumulate hero points \u2013 we&#8217;re launching our rewards program soon!)<\/p>\n<p>And if you&#8217;re not a member and want to join our community, <a href=\"https:\/\/wpmu-dev.pro\/\" target=\"_blank\">give our 7-day free trial a go<\/a> (and stick around to use our Composer repository!)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Automating WordPress installs and test builds is now even easier for developers with WPMU DEV\u2019s new Composer repository. Composer, a command line dependency management tool for PHP, has been quickly gaining popularity. Basically, if you like to automate your builds, deploys or\u00a0updates via tools like Git, Capistrano, or Roots.io\/Bedrock, then Composer makes it simple to [&hellip;]<\/p>\n","protected":false},"author":164650,"featured_media":159113,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[4161],"tags":[10532,9770],"tutorials_categories":[],"class_list":["post-159067","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wpmudev","tag-composer","tag-development-2"],"_links":{"self":[{"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/posts\/159067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/users\/164650"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/comments?post=159067"}],"version-history":[{"count":21,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/posts\/159067\/revisions"}],"predecessor-version":[{"id":209194,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/posts\/159067\/revisions\/209194"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/media\/159113"}],"wp:attachment":[{"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/media?parent=159067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/categories?post=159067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/tags?post=159067"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmu-dev.pro\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=159067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}