{% extends "PackagistWebBundle::layout.html.twig" %}

{% block content %}
<section class="row">
    <section class="col-lg-6 getting-started">
        <h2 class="title">Getting Started</h2>
        <div>
            <h3>Define Your Dependencies</h3>
            <p>Put a file named <em>composer.json</em> at the root of your project, containing your project dependencies:</p>
            <pre><code>{
    "require": {
        "vendor/package": "1.3.2",
        "vendor/package2": "1.*",
        "vendor/package3": "^2.0.3"
    }
}</code></pre>

            <p>For more information about packages versions usage, see the <a href="https://getcomposer.org/doc/01-basic-usage.md#package-versions">composer documentation</a>.</p>

            <h3>Install Composer In Your Project</h3>
            <p>Run this in your command line:</p>
            <pre><code>curl -sS https://getcomposer.org/installer | php</code></pre>
            <p>Or <a href="https://getcomposer.org/composer.phar">download composer.phar</a> into your project root.</p>
            <p>See the Composer documentation for complete <a href="https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx">installation instructions</a> on various platforms.</p>

            <h3>Install Dependencies</h3>
            <p>Execute this in your project root.</p>
            <pre><code>php composer.phar install</code></pre>

            <h3>Autoload Dependencies</h3>
            <p>If your packages specify <a href="https://getcomposer.org/doc/01-basic-usage.md#autoloading">autoloading information</a>, you can autoload all the dependencies by adding this to your code:</p>
            <pre><code>require 'vendor/autoload.php';</code></pre>
            <p><a href="{{ path('browse') }}">Browse</a> the packages we have to find more great libraries you can use in your project.</p>
        </div>
    </section>

    <section class="col-lg-6 publishing-packages">
        <h2 class="title">Publishing Packages</h2>
        <div>
            <h3>Define Your Package</h3>
            <p>Put a file named <em>composer.json</em> at the root of your package, containing this information:</p>
            <pre><code>{
    "name": "your-vendor-name/package-name",
    "description": "A short description of what your package does",
    "require": {
        "php": ">=5.3.0",
        "another-vendor/package": "1.*"
    }
}</code></pre>
            <p>This is the strictly minimal information you have to give.</p>
            <p>For more details about package naming and the fields you can use to document your package better, see the <a href="{{ path('about') }}">about</a> page.</p>

            <h3>Commit The File</h3>
            <p>You surely don't need help with that.</p>

            <h3>Publish It</h3>
            <p><a href="{{ path('hwi_oauth_connect') }}">Login</a> or <a href="{{ path('fos_user_registration_register') }}">register</a> on this site, then hit the <a href="{{ path('submit') }}">submit</a> button in the menu.</p>
            <p>Once you entered your public repository URL in there, your package will be automatically crawled periodically. You just have to make sure you keep the composer.json file up to date.</p>
        </div>
    </section>
</section>
{% endblock %}
