|
@@ -14,30 +14,30 @@
|
|
<h2>Define Your Dependencies</h2>
|
|
<h2>Define Your Dependencies</h2>
|
|
<p>Put a file named <em>composer.json</em> at the root of your project, containing your project dependencies:</p>
|
|
<p>Put a file named <em>composer.json</em> at the root of your project, containing your project dependencies:</p>
|
|
<pre>
|
|
<pre>
|
|
- {
|
|
|
|
- "require": {
|
|
|
|
- "vendor/package": "1.3.2",
|
|
|
|
- "vendor/package2": "1.*",
|
|
|
|
- "vendor/package3": ">=2.0.3"
|
|
|
|
- }
|
|
|
|
|
|
+{
|
|
|
|
+ "require": {
|
|
|
|
+ "vendor/package": "1.3.2",
|
|
|
|
+ "vendor/package2": "1.*",
|
|
|
|
+ "vendor/package3": ">=2.0.3"
|
|
}
|
|
}
|
|
- </pre>
|
|
|
|
|
|
+}
|
|
|
|
+</pre>
|
|
<h2>Install Composer In Your Project</h2>
|
|
<h2>Install Composer In Your Project</h2>
|
|
<p>Run this in your command line:</p>
|
|
<p>Run this in your command line:</p>
|
|
<pre>
|
|
<pre>
|
|
- wget http://getcomposer.org/composer.phar
|
|
|
|
- </pre>
|
|
|
|
|
|
+wget http://getcomposer.org/composer.phar
|
|
|
|
+</pre>
|
|
<p>Or <a href="http://getcomposer.org/composer.phar">download composer</a> into your project root.</p>
|
|
<p>Or <a href="http://getcomposer.org/composer.phar">download composer</a> into your project root.</p>
|
|
<h2>Install Dependencies</h2>
|
|
<h2>Install Dependencies</h2>
|
|
<p>Execute this in your project root.</p>
|
|
<p>Execute this in your project root.</p>
|
|
<pre>
|
|
<pre>
|
|
- php composer.phar install
|
|
|
|
- </pre>
|
|
|
|
|
|
+php composer.phar install
|
|
|
|
+</pre>
|
|
<h2>Autoload Dependencies</h2>
|
|
<h2>Autoload Dependencies</h2>
|
|
<p>If all your packages follow the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0</a> standard, you can autoload all the dependencies by adding this to your code:</p>
|
|
<p>If all your packages follow the <a href="https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md">PSR-0</a> standard, you can autoload all the dependencies by adding this to your code:</p>
|
|
<pre>
|
|
<pre>
|
|
- require 'vendor/.composer/autoload.php';
|
|
|
|
- </pre>
|
|
|
|
|
|
+require 'vendor/.composer/autoload.php';
|
|
|
|
+</pre>
|
|
|
|
|
|
<p><a href="{{ path('browse') }}">Browse</a> the packages we have to find more great libraries you can use in your project.</p>
|
|
<p><a href="{{ path('browse') }}">Browse</a> the packages we have to find more great libraries you can use in your project.</p>
|
|
</div>
|
|
</div>
|
|
@@ -49,14 +49,14 @@
|
|
<h2>Define Your Package</h2>
|
|
<h2>Define Your Package</h2>
|
|
<p>Put a file named <em>composer.json</em> at the root of your package, containing this information:</p>
|
|
<p>Put a file named <em>composer.json</em> at the root of your package, containing this information:</p>
|
|
<pre>
|
|
<pre>
|
|
- {
|
|
|
|
- "name": "your-vendor-name/package-name",
|
|
|
|
- "require": {
|
|
|
|
- "php": ">=5.3.0",
|
|
|
|
- "another-vendor/package": "1.*",
|
|
|
|
- }
|
|
|
|
|
|
+{
|
|
|
|
+ "name": "your-vendor-name/package-name",
|
|
|
|
+ "require": {
|
|
|
|
+ "php": ">=5.3.0",
|
|
|
|
+ "another-vendor/package": "1.*"
|
|
}
|
|
}
|
|
- </pre>
|
|
|
|
|
|
+}
|
|
|
|
+</pre>
|
|
<p>This is the strictly minimal information you have to give.</p>
|
|
<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>
|
|
<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>
|
|
<h2>Commit The File</h2>
|
|
<h2>Commit The File</h2>
|