illuminatech / config

Manage Laravel configuration by persistent storage
Other
150 stars 14 forks source link

Long delays to optimize autoloader when using package #17

Closed asiral closed 1 year ago

asiral commented 1 year ago

What steps will reproduce the problem?

When running composer install --no-dev --optimize-autoloader -vvv, the command php -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='1536M' artisan package:discover --ansi is also run.

Because this loads the service providers, a database connection will be attempted for the configuration items. When, for example, building your code base on a CI/CD server, this will hang until a timeout because it cannot connect to the database.

What is the expected result?

Avoid a database connection during artisan/build commands.

What do you get instead?

Timeout on database connections.

Additional info

Q A
This Package Version 1.4.0
Laravel Framework Version 10.13.5
PHP version 8.1.20
Operating system CentOS 7.9