Skip to content

Commit a23e7d2

Browse files
committed
feature #4643 How to override vendor directory location (gajdaw)
This PR was merged into the 2.3 branch. Discussion ---------- How to override vendor directory location | Q | A | ------------- | --- | Doc fix? | [no] | New docs? | [no] | Applies to | [Symfony 2.3] | Fixed tickets | [#4642] Commits ------- 0875bd8 How to override vendor directory location - fix 07f6843 How to override vendor directory location - fix bce4c16 How to override vendor directory location
2 parents f9c1389 + 0875bd8 commit a23e7d2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

cookbook/configuration/override_dir_structure.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,38 @@ the ``extra.symfony-web-dir`` option in the ``composer.json`` file:
154154
155155
$ php app/console cache:clear --env=prod
156156
$ php app/console assetic:dump --env=prod --no-debug
157+
158+
Override the ``vendor`` Directory
159+
---------------------------------
160+
161+
To override the ``vendor`` directory you have to introduce changes in the
162+
following files:
163+
164+
* ``app/autoload.php``
165+
* ``composer.json``
166+
167+
The change in the ``composer.json`` takes the form:
168+
169+
.. code-block:: json
170+
171+
{
172+
...
173+
"config": {
174+
"bin-dir": "bin",
175+
"vendor-dir": "/some/dir/vendor"
176+
},
177+
...
178+
}
179+
180+
In ``app/autoload.php`` you need to modify the path leading to ``vendor/autoload.php``
181+
file::
182+
183+
// app/autoload.php
184+
// ...
185+
$loader = require '/some/dir/vendor/autoload.php';
186+
187+
.. tip::
188+
189+
This modification can be of interest if you work using virtual environment
190+
and cannot use NFS. For example, when running Symfony app using Vagrant/VirtualBox
191+
guest operating system.

0 commit comments

Comments
 (0)