- 🇭🇺Hungary djg_tram
Requires "league/oauth2-server" and some other packages. See composer.json.
I am getting the same error PHP Fatal error: Interface 'League\OAuth2\Server\Repositories\ClientRepositoryInterface' not found
the root cause is the vendor directory is getting recreated as my application is running in container so the library "league/oauth2-server" is not being present in vendor and hence the error is encountered while running dbupdate.
Can we keep the library in some other persistant storage and refer from there to autoload.- 🇭🇺Hungary djg_tram
No, that's not how it works. If you use Docker, for instance, it's your responsibility to add dependent packages each time the container is rebuilt. I usually do it by adding an
.sh
script in aninit
folder, then referencing from thedocker-compose.override.yml
asvolumes: - codebase:/var/www/html - ./init/30-composer.sh:/docker-entrypoint-init.d/30-composer.sh
The actual script can call the usual
composer require
calls but if you want to make sure you only call them unless it's already installed, you can use:composer show | grep -q foo/bar || composer require foo/bar