Skip to content

Commit 6e077a2

Browse files
committed
use a global Composer installation
1 parent 7b16d3b commit 6e077a2

File tree

15 files changed

+95
-97
lines changed

15 files changed

+95
-97
lines changed

book/from_flat_php_to_symfony2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ into a vendor/ directory:
447447

448448
.. code-block:: bash
449449
450-
$ php composer.phar install
450+
$ composer install
451451
452452
Beside downloading your dependencies, Composer generates a ``vendor/autoload.php`` file,
453453
which takes care of autoloading for all the files in the Symfony Framework as well as

book/installation.rst

Lines changed: 12 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,13 @@ Option 1) Composer
4141
`Composer`_ is a dependency management library for PHP, which you can use
4242
to download the Symfony Standard Edition.
4343

44-
Start by `downloading Composer`_ anywhere onto your local computer. If you
45-
have curl installed, it's as easy as:
44+
Start by :doc:`installing Composer globally </cookbook/composer>` onto your
45+
local computer. Composer is an executable PHAR file, which you can use to
46+
download the Standard Distribution:
4647

4748
.. code-block:: bash
4849
49-
$ curl -s https://getcomposer.org/installer | php
50-
51-
.. note::
52-
53-
If your computer is not ready to use Composer, you'll see some recommendations
54-
when running this command. Follow those recommendations to get Composer
55-
working properly.
56-
57-
Composer is an executable PHAR file, which you can use to download the Standard
58-
Distribution:
59-
60-
.. code-block:: bash
61-
62-
$ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/Symfony '2.3.*'
50+
$ composer create-project symfony/framework-standard-edition /path/to/webroot/Symfony '2.3.*'
6351
6452
.. tip::
6553

@@ -150,42 +138,23 @@ Depending on how you downloaded Symfony, you may or may not need to update
150138
your vendors right now. But, updating your vendors is always safe, and guarantees
151139
that you have all the vendor libraries you need.
152140

153-
Step 1: Get `Composer`_ (The great new PHP packaging system)
154-
155-
.. code-block:: bash
156-
157-
$ curl -s http://getcomposer.org/installer | php
158-
159-
Make sure you download ``composer.phar`` in the same folder where
160-
the ``composer.json`` file is located (this is your Symfony project
161-
root by default).
141+
Step 1: :doc:`Globally install Composer </cookbook/composer>` (the great new
142+
PHP packaging system)
162143

163144
Step 2: Install vendors
164145

165146
.. code-block:: bash
166147
167-
$ php composer.phar install
148+
$ composer install
168149
169150
This command downloads all of the necessary vendor libraries - including
170151
Symfony itself - into the ``vendor/`` directory.
171152

172-
.. note::
173-
174-
If you don't have ``curl`` installed, you can also just download the ``installer``
175-
file manually at http://getcomposer.org/installer. Place this file into your
176-
project and then run:
177-
178-
.. code-block:: bash
179-
180-
$ php installer
181-
$ php composer.phar install
182-
183153
.. tip::
184154

185-
When running ``php composer.phar install`` or ``php composer.phar update``,
186-
Composer will execute post install/update commands to clear the cache
187-
and install assets. By default, the assets will be copied into your ``web``
188-
directory.
155+
When running ``composer install`` or ``composer update``, Composer will
156+
execute post install/update commands to clear the cache and install assets.
157+
By default, the assets will be copied into your ``web`` directory.
189158

190159
Instead of copying your Symfony assets, you can create symlinks if
191160
your operating system supports it. To create symlinks, add an entry
@@ -357,15 +326,14 @@ file:
357326
358327
Now, the vendor directory won't be committed to source control. This is fine
359328
(actually, it's great!) because when someone else clones or checks out the
360-
project, they can simply run the ``php composer.phar install`` script to
361-
install all the necessary project dependencies.
329+
project, they can simply run the ``composer install`` script to install all
330+
the necessary project dependencies.
362331

363332
.. _`enable ACL support`: https://help.ubuntu.com/community/FilePermissionsACLs
364333
.. _`http://symfony.com/download`: http://symfony.com/download
365334
.. _`Git`: http://git-scm.com/
366335
.. _`GitHub Bootcamp`: http://help.github.com/set-up-git-redirect
367336
.. _`Composer`: http://getcomposer.org/
368-
.. _`downloading Composer`: http://getcomposer.org/download/
369337
.. _`Apache`: http://httpd.apache.org/docs/current/mod/core.html#documentroot
370338
.. _`Nginx`: http://wiki.nginx.org/Symfony
371339
.. _`Symfony Installation Page`: http://symfony.com/download

book/performance.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ command line, and might become part of your deploy process:
6060

6161
.. code-block:: bash
6262
63-
$ php composer.phar dump-autoload --optimize
63+
$ composer dump-autoload --optimize
6464
6565
Internally, this builds the big class map array in ``vendor/composer/autoload_classmap.php``.
6666

@@ -128,8 +128,7 @@ Note that there are two disadvantages when using a bootstrap file:
128128
* when debugging, one will need to place break points inside the bootstrap file.
129129

130130
If you're using the Symfony Standard Edition, the bootstrap file is automatically
131-
rebuilt after updating the vendor libraries via the ``php composer.phar install``
132-
command.
131+
rebuilt after updating the vendor libraries via the ``composer install`` command.
133132

134133
Bootstrap Files and Byte Code Caches
135134
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

components/dependency_injection/lazy_services.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ the `ProxyManager bridge`_:
3030

3131
.. code-block:: bash
3232
33-
$ php composer.phar require symfony/proxy-manager-bridge:~2.3
33+
$ composer require symfony/proxy-manager-bridge:~2.3
3434
3535
.. note::
3636

components/intl.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ code::
8585
the server.
8686

8787
For example, consider that your development machines ship ICU 4.8 and the server
88-
ICU 4.2. When you run ``php composer.phar update`` on the development machine, version
88+
ICU 4.2. When you run ``composer update`` on the development machine, version
8989
1.2.* of the Icu component will be installed. But after deploying the
90-
application, ``php composer.phar install`` will fail with the following error:
90+
application, ``composer install`` will fail with the following error:
9191

9292
.. code-block:: bash
9393
94-
$ php composer.phar install
94+
$ composer install
9595
Loading composer repositories with package information
9696
Installing dependencies from lock file
9797
Your requirements could not be resolved to an installable set of packages.
@@ -104,8 +104,8 @@ code::
104104
The error tells you that the requested version of the Icu component, version
105105
1.2, is not compatible with PHP's ICU version 4.2.
106106

107-
One solution to this problem is to run ``php composer.phar update`` instead of
108-
``php composer.phar install``. It is highly recommended **not** to do this. The
107+
One solution to this problem is to run ``composer update`` instead of
108+
``composer install``. It is highly recommended **not** to do this. The
109109
``update`` command will install the latest versions of each Composer dependency
110110
to your production server and potentially break the application.
111111

@@ -130,7 +130,7 @@ code::
130130
* "1.0.*" if the server does not have the intl extension installed;
131131
* "1.1.*" if the server is compiled with ICU 4.2 or lower.
132132

133-
Finally, run ``php composer.phar update symfony/icu`` on your development machine, test
133+
Finally, run ``composer update symfony/icu`` on your development machine, test
134134
extensively and deploy again. The installation of the dependencies will now
135135
succeed.
136136

components/using_components.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ whatever component you want.
3131

3232
.. tip::
3333

34-
If you get a command not found for ``composer``, you'll need to
35-
`Install composer`_. Depending on how you install, you may end up with
36-
a ``composer.phar`` file in your directory. In that case, no worries!
37-
Just run ``php composer.phar require symfony/finder``.
34+
`Install composer`_ if you don't have it already present on your system.
35+
Depending on how you install, you may end up with a ``composer.phar``
36+
file in your directory. In that case, no worries! Just run
37+
``php composer.phar require symfony/finder``.
3838

3939
If you know you need a specific version of the library, add that to the command:
4040

4141
.. code-block:: bash
4242
43-
$ composer require symfony/finder:~2.3
43+
$ composer require symfony/finder
4444
4545
**3.** Write your code!
4646

contributing/code/tests.rst

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,42 +28,24 @@ The test suite needs the following third-party libraries:
2828

2929
To install them all, use `Composer`_:
3030

31-
Step 1: Get `Composer`_
31+
Step 1: :doc:`Install Composer globally </cookbook/composer>`
3232

33-
.. code-block:: bash
34-
35-
$ curl -s http://getcomposer.org/installer | php
36-
37-
Make sure you download ``composer.phar`` in the same folder where
38-
the ``composer.json`` file is located.
39-
40-
Step 2: Install vendors
33+
Step 2: Install vendors.
4134

4235
.. code-block:: bash
4336
44-
$ php composer.phar install
37+
$ composer install
4538
4639
.. note::
4740

4841
Note that the script takes some time to finish.
4942

50-
.. note::
51-
52-
If you don't have ``curl`` installed, you can also just download the ``installer``
53-
file manually at http://getcomposer.org/installer. Place this file into your
54-
project and then run:
55-
56-
.. code-block:: bash
57-
58-
$ php installer
59-
$ php composer.phar install
60-
6143
After installation, you can update the vendors to their latest version with
6244
the follow command:
6345

6446
.. code-block:: bash
6547
66-
$ php composer.phar update
48+
$ composer --dev update
6749
6850
Running
6951
-------

cookbook/bundles/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Now that you know the package name, you can install it via Composer:
3636

3737
.. code-block:: bash
3838
39-
$ php composer.phar require friendsofsymfony/user-bundle
39+
$ composer require friendsofsymfony/user-bundle
4040
4141
This will choose the best version for your project, add it to ``composer.json``
4242
and download the library into the ``vendor/`` directory. If you need a specific

cookbook/composer.rst

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.. index::
2+
double: Composer; Installation
3+
4+
Installing Composer
5+
===================
6+
7+
`Composer`_ is the package manager used by modern PHP applications and the
8+
recommended way to install Symfony2.
9+
10+
Install Composer on Linux and Mac OS X
11+
--------------------------------------
12+
13+
To install Composer on Linux or Mac OS X, execute the following two commands:
14+
15+
.. code-block:: bash
16+
17+
$ curl -sS https://getcomposer.org/installer | php
18+
$ sudo mv composer.phar /usr/local/bin/composer
19+
20+
-.. note::
21+
22+
If you don't have ``curl`` installed, you can also just download the
23+
``installer`` file manually at http://getcomposer.org/installer. Place
24+
this file into your project and then run:
25+
26+
.. code-block:: bash
27+
28+
$ php installer
29+
$ sudo mv composer.phar /usr/local/bin/composer
30+
31+
Install Composer on Windows
32+
---------------------------
33+
34+
Download the installer from `getcomposer.org/download`_, execute it and follow
35+
the instructions.
36+
37+
Learn more
38+
----------
39+
40+
You can read more about Composer in `its documentation`_.
41+
42+
.. _`Composer`: https://getcomposer.org/
43+
.. _`getcomposer.org/download`: https://getcomposer.org/download
44+
.. _`its documentation`: https://getcomposer.org/doc/00-intro.md

cookbook/deployment/tools.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ as you normally do:
101101

102102
.. code-block:: bash
103103
104-
$ php composer.phar install --no-dev --optimize-autoloader
104+
$ composer install --no-dev --optimize-autoloader
105105
106106
.. tip::
107107

@@ -142,7 +142,7 @@ setup:
142142

143143
* Running any database migrations
144144
* Clearing your APC cache
145-
* Running ``assets:install`` (taken care of already in ``composer.phar install``)
145+
* Running ``assets:install`` (already taken care of in ``composer install``)
146146
* Add/edit CRON jobs
147147
* Pushing assets to a CDN
148148
* ...

0 commit comments

Comments
 (0)