m2mdas / phpcomplete-extended

A fast, extensible, context aware autocomplete plugin for PHP composer projects with code inspection features.
MIT License
216 stars 23 forks source link

Support having a different vendor path. #43

Open Sheco opened 9 years ago

Sheco commented 9 years ago

You can specify an alternate vendor path in the composer.json config.

"config": {
    "vendor-dir": "/path/to/vendor"
},

We need to update bin/IndexGenerator.php to read the composer.json and then update the following lines:

bin/IndexGenerator.php:237

$this->loader = require 'vendor/autoload.php';

bin/IndexGenerator:382

$autoloadNamespaces = require 'vendor/composer/autoload_namespaces.php';

bin/IndexGenerator:417

$classMap = require 'vendor/composer/autoload_classmap.php';
mariuswilms commented 9 years ago

I'm using the lithium framework together with composer. Lithium expects the libraries to be placed inside a libraries folder instead of vendor. Working on many lithium projects, having a non-standard vendor directory isn't uncommon.

https://github.com/composer/installers/blob/master/src/Composer/Installers/LithiumInstaller.php#L7