Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to override vendor directory location #4643

Merged
merged 3 commits into from
Jan 16, 2015
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions cookbook/configuration/override_dir_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,38 @@ the ``extra.symfony-web-dir`` option in the ``composer.json`` file:

$ php app/console cache:clear --env=prod
$ php app/console assetic:dump --env=prod --no-debug

Override the ``vendor`` Directory
---------------------------------

To override the ``vendor`` directory you have to introduce changes in the
following files:

* ``app/autoload.php``
* ``composer.json``

The change in the ``composer.json`` takes the form:

.. code-block:: json

{
...
"config": {
"bin-dir": "bin",
"vendor-dir": "/some/dir/vendor"
},
...
}

In ``app/autoload.php`` you need to modify the path leading to ``vendor/autoload.php``
file::

// app/autoload.php

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now you just need to remove this empty line and everything is ok. Thanks for your quick action each time!

$loader = require '/some/dir/vendor/autoload.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a placeholder comment (// ...) after this line to indicate that we don't show the complete file.


.. tip::

This modification can be of interest if you work using virtual environment
and cannot use NFS. For example, when running Symfony app using Vagrant/VirtualBox
guest operating system.