<commit_before><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Composer - To quality and beyond</title>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Composer">
    <meta name="twitter:description" content="">

    <meta property="og:type" content="article">
    <meta property="og:title" content="Composer">
    <meta property="og:description" content="">

    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon">

    <link rel="stylesheet" type="text/css" href="//blog.wanjee.be/themes/uno/assets/css/uno.css?v=1.0.0" />

    <link rel="canonical" href="http://blog.wanjee.be/2015/05/25/Composer.html" />
    
    <meta property="og:site_name" content="To quality and beyond" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Composer" />
    <meta property="og:description" content="What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..." />
    <meta property="og:url" content="http://blog.wanjee.be/2015/05/25/Composer.html" />
    <meta property="article:published_time" content="2015-05-24T22:00:00.000Z" />
    <meta property="article:modified_time" content="2015-05-27T16:23:36.159Z" />
    <meta property="article:tag" content="Quality" />
    <meta property="article:tag" content="Drupal" />
    <meta property="article:tag" content="Symfony2" />
    
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Composer" />
    <meta name="twitter:description" content="What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..." />
    <meta name="twitter:url" content="http://blog.wanjee.be/2015/05/25/Composer.html" />
    
    <script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Article",
    "publisher": "To quality and beyond",
    "author": {
        "@type": "Person",
        "name": "",
        "image": "https://avatars.githubusercontent.com/u/3372615?v=3",
        "url": "undefined/author/undefined",
        "sameAs": ""
    },
    "headline": "Composer",
    "url": "http://blog.wanjee.be/2015/05/25/Composer.html",
    "datePublished": "2015-05-24T22:00:00.000Z",
    "dateModified": "2015-05-27T16:23:36.159Z",
    "keywords": "Quality, Drupal, Symfony2",
    "description": "What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..."
}
    </script>

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="To quality and beyond" href="http://blog.wanjee.be/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

</head>
<body class="post-template tag-Quality tag-Drupal tag-Symfony2 no-js">

    <span class="mobile btn-mobile-menu">
        <i class="icon icon-list btn-mobile-menu__icon"></i>
        <i class="icon icon-x-circle btn-mobile-close__icon hidden"></i>
    </span>

    <header class="panel-cover panel-cover--collapsed " >
      <div class="panel-main">
    
        <div class="panel-main__inner panel-inverted">
        <div class="panel-main__content">
    
            <a href="http://blog.wanjee.be" title="link to homepage for To quality and beyond"><img src="http://wanjee.be/blog/templates/wanjee/avatar.jpg" width="80" alt="To quality and beyond logo" class="panel-cover__logo logo" /></a>
            <h1 class="panel-cover__title panel-title"><a href="http://blog.wanjee.be" title="link to homepage for To quality and beyond">To quality and beyond</a></h1>
            <hr class="panel-cover__divider" />
            <p class="panel-cover__description">Quality focused small posts about PHP projects (Symfony, Drupal) and web development best practices in general.</p>
            <hr class="panel-cover__divider panel-cover__divider--secondary" />
    
            <div class="navigation-wrapper">
    
              <nav class="cover-navigation cover-navigation--primary">
                <ul class="navigation">
                  <li class="navigation__item"><a href="http://blog.wanjee.be/#blog" title="link to To quality and beyond blog" class="blog-button">Blog</a></li>
                </ul>
              </nav>
    
              
              
              <nav class="cover-navigation navigation--social">
                <ul class="navigation">
              
              
                  <!-- Twitter -->
                  <li class="navigation__item">
                    <a href="http://twitter.com/wanjee" title="Twitter account">
                      <i class='icon icon-social-twitter'></i>
                      <span class="label">Twitter</span>
                    </a>
                  </li>
              
              
                  <!-- Github -->
                  <li class="navigation__item">
                    <a href="https://github.com/wanjee" title="Github account">
                      <i class='icon icon-social-github'></i>
                      <span class="label">Github</span>
                    </a>
                  </li>
                  </li>
              
              
              
              
                  <!-- LinkedIn -->
                  <li class="navigation__item">
                    <a href="http://be.linkedin.com/in/wanjee" title="LinkedIn account">
                      <i class='icon icon-social-linkedin'></i>
                      <span class="label">LinkedIn</span>
                    </a>
                  </li>
              
              
                </ul>
              </nav>
              
    
            </div>
    
          </div>
    
        </div>
    
        <div class="panel-cover--overlay"></div>
      </div>
    </header>

    <div class="content-wrapper">
        <div class="content-wrapper__inner">
            

  <article class="post-container post-container--single">

    <header class="post-header">
      <div class="post-meta">
        <time datetime="25 May 2015" class="post-meta__date date">25 May 2015</time> &#8226; <span class="post-meta__tags tags">on <a href="http://blog.wanjee.be/tag/Quality">Quality</a>, <a href="http://blog.wanjee.be/tag/Drupal">Drupal</a>, <a href="http://blog.wanjee.be/tag/Symfony2">Symfony2</a></span>
        <span class="post-meta__author author"><img src="https://avatars.githubusercontent.com/u/3372615?v=3" alt="profile image for " class="avatar post-meta__avatar" /></span>
      </div>
      <h1 class="post-title">Composer</h1>
    </header>

    <section class="post tag-Quality tag-Drupal tag-Symfony2">
      <div class="sect1">
<h2 id="_what_is_composer">What is Composer ?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript.</p>
</div>
<div class="paragraph">
<p>Add a dependency in the composer.json file and composer will take care of installing and updating it. It is used by most PHP projects like Symfony2, Silex, Laravel, Drupal8 (partially&#8230;&#8203;).  It mostly relies on Packagist to retrieve dependencies information and to allow download of them.  Packagist is the main Composer repository.  It does not hold any code but aggregates content from public source control systems like Github.  Internally we do not use Github to host anything but Composer let you define other repositories so it will be able to retrieve dependencies on our internal Git.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_understanding_versions">Understanding versions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Composer relies on Semantic versioning to know which version it needs to get.</p>
</div>
<div class="paragraph">
<p>Adding a requirement is like the following example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>{
    "require": {
        "monolog/monolog": "1.0.*"
    }
}</pre>
</div>
</div><commit_msg>Publish 2015-05-25-Composer.adoc<commit_after><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Composer - To quality and beyond</title>

    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <meta name="description" content="">

    <meta name="twitter:card" content="summary">
    <meta name="twitter:title" content="Composer">
    <meta name="twitter:description" content="">

    <meta property="og:type" content="article">
    <meta property="og:title" content="Composer">
    <meta property="og:description" content="">

    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/apple-touch-icon-precomposed.png" rel="apple-touch-icon">

    <link rel="stylesheet" type="text/css" href="//blog.wanjee.be/themes/uno/assets/css/uno.css?v=1.0.0" />

    <link rel="canonical" href="http://blog.wanjee.be/2015/05/25/Composer.html" />
    
    <meta property="og:site_name" content="To quality and beyond" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="Composer" />
    <meta property="og:description" content="What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..." />
    <meta property="og:url" content="http://blog.wanjee.be/2015/05/25/Composer.html" />
    <meta property="article:published_time" content="2015-05-24T22:00:00.000Z" />
    <meta property="article:modified_time" content="2015-05-27T16:26:49.339Z" />
    <meta property="article:tag" content="Quality" />
    <meta property="article:tag" content="Symfony2" />
    
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Composer" />
    <meta name="twitter:description" content="What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..." />
    <meta name="twitter:url" content="http://blog.wanjee.be/2015/05/25/Composer.html" />
    
    <script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Article",
    "publisher": "To quality and beyond",
    "author": {
        "@type": "Person",
        "name": "",
        "image": "https://avatars.githubusercontent.com/u/3372615?v=3",
        "url": "undefined/author/undefined",
        "sameAs": ""
    },
    "headline": "Composer",
    "url": "http://blog.wanjee.be/2015/05/25/Composer.html",
    "datePublished": "2015-05-24T22:00:00.000Z",
    "dateModified": "2015-05-27T16:26:49.339Z",
    "keywords": "Quality, Symfony2",
    "description": "What is Composer ? Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript. Add a dependency in the composer.json file and composer will take care of..."
}
    </script>

    <meta name="generator" content="Ghost ?" />
    <link rel="alternate" type="application/rss+xml" title="To quality and beyond" href="http://blog.wanjee.be/rss" />
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/default.min.css">

</head>
<body class="post-template tag-Quality tag-Symfony2 no-js">

    <span class="mobile btn-mobile-menu">
        <i class="icon icon-list btn-mobile-menu__icon"></i>
        <i class="icon icon-x-circle btn-mobile-close__icon hidden"></i>
    </span>

    <header class="panel-cover panel-cover--collapsed " >
      <div class="panel-main">
    
        <div class="panel-main__inner panel-inverted">
        <div class="panel-main__content">
    
            <a href="http://blog.wanjee.be" title="link to homepage for To quality and beyond"><img src="http://wanjee.be/blog/templates/wanjee/avatar.jpg" width="80" alt="To quality and beyond logo" class="panel-cover__logo logo" /></a>
            <h1 class="panel-cover__title panel-title"><a href="http://blog.wanjee.be" title="link to homepage for To quality and beyond">To quality and beyond</a></h1>
            <hr class="panel-cover__divider" />
            <p class="panel-cover__description">Quality focused small posts about PHP projects (Symfony, Drupal) and web development best practices in general.</p>
            <hr class="panel-cover__divider panel-cover__divider--secondary" />
    
            <div class="navigation-wrapper">
    
              <nav class="cover-navigation cover-navigation--primary">
                <ul class="navigation">
                  <li class="navigation__item"><a href="http://blog.wanjee.be/#blog" title="link to To quality and beyond blog" class="blog-button">Blog</a></li>
                </ul>
              </nav>
    
              
              
              <nav class="cover-navigation navigation--social">
                <ul class="navigation">
              
              
                  <!-- Twitter -->
                  <li class="navigation__item">
                    <a href="http://twitter.com/wanjee" title="Twitter account">
                      <i class='icon icon-social-twitter'></i>
                      <span class="label">Twitter</span>
                    </a>
                  </li>
              
              
                  <!-- Github -->
                  <li class="navigation__item">
                    <a href="https://github.com/wanjee" title="Github account">
                      <i class='icon icon-social-github'></i>
                      <span class="label">Github</span>
                    </a>
                  </li>
                  </li>
              
              
              
              
                  <!-- LinkedIn -->
                  <li class="navigation__item">
                    <a href="http://be.linkedin.com/in/wanjee" title="LinkedIn account">
                      <i class='icon icon-social-linkedin'></i>
                      <span class="label">LinkedIn</span>
                    </a>
                  </li>
              
              
                </ul>
              </nav>
              
    
            </div>
    
          </div>
    
        </div>
    
        <div class="panel-cover--overlay"></div>
      </div>
    </header>

    <div class="content-wrapper">
        <div class="content-wrapper__inner">
            

  <article class="post-container post-container--single">

    <header class="post-header">
      <div class="post-meta">
        <time datetime="25 May 2015" class="post-meta__date date">25 May 2015</time> &#8226; <span class="post-meta__tags tags">on <a href="http://blog.wanjee.be/tag/Quality">Quality</a>, <a href="http://blog.wanjee.be/tag/Symfony2">Symfony2</a></span>
        <span class="post-meta__author author"><img src="https://avatars.githubusercontent.com/u/3372615?v=3" alt="profile image for " class="avatar post-meta__avatar" /></span>
      </div>
      <h1 class="post-title">Composer</h1>
    </header>

    <section class="post tag-Quality tag-Symfony2">
      <div class="sect1">
<h2 id="_what_is_composer">What is Composer ?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Composer is a dependency manager for PHP.  It is to PHP what npm is to NodeJS and what Bower is to front-end javascript.</p>
</div>
<div class="paragraph">
<p>Add a dependency in the composer.json file and composer will take care of installing and updating it. It is used by most PHP projects like Symfony2, Silex, Laravel, Drupal8 (partially&#8230;&#8203;).  It mostly relies on Packagist to retrieve dependencies information and to allow download of them.  Packagist is the main Composer repository.  It does not hold any code but aggregates content from public source control systems like Github.  Internally we do not use Github to host anything but Composer let you define other repositories so it will be able to retrieve dependencies on our internal Git.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_understanding_versions">Understanding versions</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Composer relies on Semantic versioning to know which version it needs to get.</p>
</div>
<div class="paragraph">
<p>Adding a requirement is like the following example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre>{
    "require": {
        "monolog/monolog": "1.0.*"
    }
}</pre>
</div>
</div>
{'fraction_non_alphanumeric': 0.1521039254447896, 'fraction_numerical': 0.019994351878000565, 'mean_word_length': 2.643959662481992, 'pattern_counts': {'":': 34, '<': 336, '<?xml version=': 0, '>': 336, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4704615', 'n_tokens_mistral': 5564, 'n_tokens_neox': 5166, 'n_words': 1326}