Skip to content

Commit adf593b

Browse files
committed
Merge pull request #1111 from adurieux/details-deps
Added some details about deps management.
2 parents b8edbee + c7e8cc7 commit adf593b

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

cookbook/workflow/_vendor_deps.rst.inc

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Managing Vendor Libraries with bin/vendors and deps
22
---------------------------------------------------
33

4+
### How does it work ?
5+
6+
47
Every Symfony project uses a group of third-party "vendor" libraries. One
58
way or another the goal is to download these files into your ``vendor/``
69
directory and, ideally, to give you some sane way to manage the exact version
@@ -46,4 +49,37 @@ script to ensure that all of the needed vendor libraries are downloaded.
4649
to do with upgrading your project and you will normally not need to use
4750
it. This command is used to freeze the versions of all of your vendor libraries
4851
by updating them to the version specified in ``deps`` and recording it
49-
into the ``deps.lock`` file.
52+
into the ``deps.lock`` file.
53+
54+
55+
### Hacking vendor libraries
56+
57+
58+
Sometimes, you want a specific branch, tag, or commit of a library to be downloaded
59+
or upgraded. You can set that directly to the ``deps`` file :
60+
61+
.. code-block:: text
62+
63+
[AcmeAwesomeBundle]
64+
git=http://github.com/johndoe/Acme/AwesomeBundle.git
65+
target=/bundles/Acme/AwesomeBundle
66+
version=the-awesome-version
67+
68+
69+
* The ``git`` option sets the URL of the library. It can use various protocols, like ``http://`` as well as ``git://``.
70+
71+
* The ``target`` option specifies where the repository will live : plain Symfony bundles should go under the ``vendor/bundles/Acme`` directory, other third-party libraries usually go to ``vendor/my-awesome-library-name``. The target directory 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 (``version=origin/0.42``) or a branch name (``refs/remotes/origin/awesome-branch``). It defaults to ``origin/HEAD``.
74+
75+
76+
### Updating workflow
77+
78+
79+
When you execute the ``php bin/vendors install``, for every library, the script first checks if the install directory exists.
80+
81+
If it does not (and ONLY if it does not, it runs a ``git clone``.
82+
83+
Then, it does a ``git fetch origin`` and a ``git reset --hard the-awesome-version``.
84+
85+
This means that the repository will only be cloned once. If you want to perform any change of the git remote, you MUST delete the entire target directory, not only its content.

0 commit comments

Comments
 (0)