You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building my app in Laravel, we have consistently come across issues with calls requiring network connections in certain parts of the code and how it will impact creating the autoloader, optimizing the autoloader, etc.
For example, loading a model or sending an email from a constructor or ServiceProvider will fail with a timeout when running composer install --no-dev --optimize-autoloader -vvv which runs php -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='1536M' artisan package:discover --ansi.
I have been able to work around most issues with some refactoring, but this one repository, https://github.com/illuminatech/config, is an extension of the ConfigRepository and also uses a database layer for managing peristent configuration items. Loading a configuration item in a service provider is a reasonable task, but when running the optimization commands, for example on a third CI/CD server will hang until a timeout when trying to connect to a database for the configuration items.
Is there a way to handle this kind of situation for the optimization and autloader related commands, perhaps to spoof a connection or some other way?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
When building my app in Laravel, we have consistently come across issues with calls requiring network connections in certain parts of the code and how it will impact creating the autoloader, optimizing the autoloader, etc.
For example, loading a model or sending an email from a constructor or ServiceProvider will fail with a timeout when running
composer install --no-dev --optimize-autoloader -vvv
which runsphp -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='1536M' artisan package:discover --ansi
.I have been able to work around most issues with some refactoring, but this one repository, https://github.com/illuminatech/config, is an extension of the ConfigRepository and also uses a database layer for managing peristent configuration items. Loading a configuration item in a service provider is a reasonable task, but when running the optimization commands, for example on a third CI/CD server will hang until a timeout when trying to connect to a database for the configuration items.
Is there a way to handle this kind of situation for the optimization and autloader related commands, perhaps to spoof a connection or some other way?
Beta Was this translation helpful? Give feedback.
All reactions