Skip to content

Commit bce4c16

Browse files
committed
How to override vendor directory location
1 parent 7b16d3b commit bce4c16

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

cookbook/configuration/override_dir_structure.rst

+37
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,40 @@ 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+
* @var ClassLoader $loader
186+
*/
187+
$loader = require '/some/dir/vendor/autoload.php';
188+
189+
.. tip::
190+
191+
This modification can be of interest if you work using virtual environment
192+
and cannot use NFS. For example, when running Symfony app using Vagrant/VirtualBox
193+
guest operating system.

0 commit comments

Comments
 (0)