Sergey Sergey - 23 days ago 9
PHP Question

Composer - include from path that varies

I have two applications, and I need one app to load the other app. I could just go

"files": [
"/path/to/the/second/app"
],


in
composer.json
but the problem is that
/path/to/the/second/app
varies from server to server. The question is how can I load a file using composer if the file's path varies, but can be available in an env var or some config?

Answer

Composer doesn't support environment variables - https://github.com/composer/composer/issues/2036

You could use a symlink that gets changed each time though