8000 Removing the rest of the references to teh bin/vendor script - replac… · symfony/symfony-docs@5662f41 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5662f41

Browse files
committed
Removing the rest of the references to teh bin/vendor script - replacing with composer
1 parent 1a11e18 commit 5662f41

File tree

5 files changed

+58
-72
lines changed

5 files changed

+58
-72
lines changed

book/installation.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,17 @@ Step 2: Install vendors
9595
This command downloads all of the necessary vendor libraries - including
9696
Symfony itself - into the ``vendor/`` directory.
9797

98+
.. note::
99+
100+
If you don't have ``curl`` installed, you can also just download the ``installer``
101+
file manually at http://getcomposer.org/installer. Place this file into your
102+
project and then run:
103+
104+
.. code-block:: bash
105+
106+
php installer
107+
php composer.phar install
108+
98109
Configuration and Setup
99110
~~~~~~~~~~~~~~~~~~~~~~~
100111

@@ -215,7 +226,7 @@ file:
215226
216227
Now, the vendor directory won't be committed to source control. This is fine
217228
(actually, it's great!) because when someone else clones or checks out the
218-
project, he/she can simply run the ``php bin/vendors install`` script to
229+
project, he/she can simply run the ``php composer.phar install`` script to
219230
download all the necessary vendor libraries.
220231

221232
.. _`enable ACL support`: https://help.ubuntu.com/community/FilePermissions#ACLs

book/performance.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Note that there are two disadvantages when using a bootstrap file:
109109
* when debugging, one will need to place break points inside the bootstrap file.
110110

111111
If you're using Symfony2 Standard Edition, the bootstrap file is automatically
112-
rebuilt after updating the vendor libraries via the ``php bin/vendors install``
112+
rebuilt after updating the vendor libraries via the ``php composer.phar install``
113113
command.
114114

115115
Bootstrap Files and Byte Code Caches
Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Managing Vendor Libraries with bin/vendors and deps
2-
---------------------------------------------------
1+
Managing Vendor Libraries with composer.json
2+
--------------------------------------------
33

44
### How does it work ?
55

@@ -8,80 +8,43 @@ way or another the goal is to download these files into your ``vendor/``
88
directory and, ideally, to give you some sane way to manage the exact version
99
you need for each.
1010

11-
By default, these libraries are downloaded by running a ``php bin/vendors install``
12-
"downloader" script. This script reads from the ``deps`` file at the root
13-
of your project. This is an ini-formatted script, which holds a list of each
14-
of the external libraries you need, the directory each should be downloaded to,
15-
and (optionally) the version to be downloaded. The ``bin/vendors`` script
16-
uses ``git`` to downloaded these, solely because these external libraries
17-
themselves tend to be stored via git. The ``bin/vendors`` script also reads
18-
the ``deps.lock`` file, which allows you to pin each library to an exact
19-
git commit hash.
11+
By default, these libraries are downloaded by running a ``php composer.phar install``
12+
"downloader" binary. This ``composer.phar`` file is from a library called
13+
`Composer`_ and you can read more about installing it in the :ref:`Installation<installation-updating-vendors>`
14+
chapter.
15+
16+
The ``composer.phar`` file reads from the ``composer.json`` file at the root
17+
of your project. This is an JSON-formatted file, which holds a list of each
18+
of the external packages you need, the version to be downloaded and more.
19+
The ``composer.phar`` file also reads from a ``composer.lock`` file, which
20+
allows you to pin each library to an **exact** version. In fact, if a ``composer.lock``
21+
file exists, the versions inside will override those in ``composer.json``.
22+
To upgrade your libraries to new versions, run ``php composer.phar update``.
23+
24+
To learn more about Composer, see `GetComposer.org`_:
2025

2126
It's important to realize that these vendor libraries are *not* actually part
2227
of *your* repository. Instead, they're simply un-tracked files that are downloaded
23-
into the ``vendor/`` directory by the ``bin/vendors`` script. But since all
24-
the information needed to download these files is saved in ``deps`` and ``deps.lock``
25-
(which *are* stored) in our repository), any other developer can use our
26-
project, run ``php bin/vendors install``, and download the exact same set
27-
of vendor libraries. This means that you're controlling exactly what each
28-
vendor library looks like, without needing to actually commit them to *your*
29-
repository.
30-
31-
So, whenever a developer uses your project, he/she should run the ``php bin/vendors install``
28+
into the ``vendor/``. But since all the information needed to download these
29+
files is saved in ``composer.json`` and ``composer.lock`` (which *are* stored)
30+
in our repository, any other developer can use our project, run ``php composer.phar install``,
31+
and download the exact same set of vendor libraries. This means that you're
32+
controlling exactly what each vendor library looks like, without needing to
33+
actually commit them to *your* repository.
34+
35+
So, whenever a developer uses your project, he/she should run the ``php composer.phar install``
3236
script to ensure that all of the needed vendor libraries are downloaded.
3337

3438
.. sidebar:: Upgrading Symfony
3539

3640
Since Symfony is just a group of third-party libraries and third-party
37-
libraries are entirely controlled through ``deps`` and ``deps.lock``,
41+
libraries are entirely controlled through ``composer.json`` and ``composer.lock``,
3842
upgrading Symfony means simply upgrading each of these files to match
3943
their state in the latest Symfony Standard Edition.
4044

41-
Of course, if you've added new entries to ``deps`` or ``deps.lock``, be sure
45+
Of course, if you've added new entries to ``composer.json``, be sure
4246
to replace only the original parts (i.e. be sure not to also delete any of
4347
your custom entries).
4448

45-
.. caution::
46-
47-
There is also a ``php bin/vendors update`` command, but this has nothing
48-
to do with upgrading your project and you will normally not need to use
49-
it. This command is used to freeze the versions of all of your vendor libraries
50-
by updating them to the version specified in ``deps`` and recording it
51-
into the ``deps.lock`` file.
52-
53-
### Hacking vendor libraries
54-
55-
Sometimes, you want a specific branch, tag, or commit of a library to be downloaded
56-
or upgraded. You can set that directly to the ``deps`` file :
57-
58-
.. code-block:: text
59-
60-
[AcmeAwesomeBundle]
61-
git=http://github.com/johndoe/Acme/AwesomeBundle.git
62-
target=/bundles/Acme/AwesomeBundle
63-
version=the-awesome-version
64-
65-
* The ``git`` option sets the URL of the library. It can use various protocols,
66-
like ``http://`` as well as ``git://``.
67-
68-
* The ``target`` option specifies where the repository will live : plain Symfony
69-
bundles should go under the ``vendor/bundles/Acme`` directory, other third-party
70-
libraries usually go to ``vendor/my-awesome-library-name``. The target directory
71-
defaults to this last option when not specified.
72-
73-
* The ``version`` option allows you to set a specific revision. You can use a tag
74-
(``version=origin/0.42``) or a branch name (``refs/remotes/origin/awesome-branch``).
75-
It defaults to ``origin/HEAD``.
76-
77-
### Updating workflow
78-
79-
When you execute the ``php bin/vendors install``, for every library, the script first
80-
checks if the install directory exists.
81-
82-
If it does not (and ONLY if it does not), it runs a ``git clone``.
83-
84-
Then, it does a ``git fetch origin`` and a ``git reset --hard the-awesome-version``.
85-
86-
This means that the repository will only be cloned once. If you want to perform any
87-
change of the git remote, you MUST delete the entire target directory, not only its content.
49+
.. _Composer: http://getcomposer.org/
50+
.. _GetComposer.org: http://getcomposer.org/

cookbook/workflow/new_project_git.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,12 @@ to learn more about how to configure and develop inside your application.
8181
Vendors and Submodules
8282
~~~~~~~~~~~~~~~~~~~~~~
8383

84-
Instead of using the ``deps``, ``bin/vendors`` system for managing your vendor
84+
Instead of using the ``composer.json`` system for managing your vendor
8585
libraries, you may instead choose to use native `git submodules`_. There
86-
is nothing wrong with this approach, though the ``deps`` system is the official
87-
way to solve this problem and git submodules can be difficult to work with
88-
at times.
86+
is nothing wrong with this approach, though the ``composer.json`` system
87+
is the official way to solve this problem and probably much easier to
88+
deal with. Unlike git submodules, ``Composer`` is smart enough to calculate
89+
which libraries depend on which other libraries.
8990

9091
Storing your Project on a Remote Server
9192
---------------------------------------

quick_tour/the_big_picture.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,18 @@ have a ``Symfony/`` directory that looks like this:
5858

5959
.. code-block:: bash
6060
61-
php bin/vendors install
61+
curl -s http://getcomposer.org/installer | php
62+
63+
php composer.phar install
64+
65+
If you don't have ``curl`` installed, you can also just download the ``installer``
66+
file manually at http://getcomposer.org/installer. Place this file into your
67+
project and then run:
68+
69+
.. code-block:: bash
70+
71+
php installer
72+
php composer.phar install
6273

6374
Checking the Configuration
6475
--------------------------

0 commit comments

Comments
 (0)
0