Skip to content

Commit 55a32cf

Browse files
committed
feature #4173 use a global Composer installation (xabbuh)
This PR was merged into the 2.3 branch. Discussion ---------- use a global Composer installation | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #4170 This pull request replaces all mentions of local Composer installations, but uses a gobal Composer installation instead. **Note:** This should be considered on hold and not be merged until we have an agreement on this in #4170. Commits ------- 9ab1c56 use a global Composer installation
2 parents 0db36ea + 9ab1c56 commit 55a32cf

File tree

14 files changed

+83
-62
lines changed

14 files changed

+83
-62
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: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,7 @@ don't have installed it globally, start by reading the next section.
117117
Installing Composer Globally
118118
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119119

120-
On Linux and Mac OS X, execute the following two commands to install Composer
121-
globally:
122-
123-
.. code-block:: bash
124-
125-
$ curl -sS https://getcomposer.org/installer | php
126-
$ sudo mv composer.phar /usr/local/bin/composer
127-
128-
On Windows Systems, download the executable Composer installer that you can find
129-
on the `Composer download page`_ and follow the steps.
120+
Start with :doc:`installing Composer globally </cookbook/composer>`.
130121

131122
Creating a Symfony Application with Composer
132123
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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 and
24+
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)