This repository has been archived by the owner on Feb 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 89
Warmup lazy services #278
Comments
This is only currently possible by running through the instantiation of all services once, in a warmup script. |
So I need to write this script or it exists somewhere? |
You'll need to write a script, yup.
I think its contents would be something like `array_walk([$serviceManager,
'get'], $serviceManager->getDefinedServices())` or similar
…On Thu, 14 Feb 2019, 09:55 Witold Wasiczko ***@***.*** wrote:
So I need to write this script or it exists somewhere?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#278 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakJdt0x1GZA58nvHJgPTLHbTvdJoWks5vNSSSgaJpZM4a7FkL>
.
|
Or: public function warmup(): void
{
foreach ($this->services as $service) {
$this->container->get($service);
}
} where Anyway ready script in package will be nice addon |
Don't think we should expand the API for an edge case, and adding a script
also requires knowing which instance of the ServiceManager you are
referring to.
In a zendframework/zend-mvc context, that may be any of the plugin
containers, for example.
…On Thu, 14 Feb 2019, 10:06 Witold Wasiczko ***@***.*** wrote:
Or:
public function warmup(): void { foreach ($this->services as $service) { $this->container->get($service); } }
where services' is lazy_services.class_map` keys.
Anyway ready script in package will be nice addon
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#278 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJakCtLHTLTFvUbctEJEk7djF75cLz_ks5vNSb7gaJpZM4a7FkL>
.
|
Or zf module ;) |
This repository has been closed and moved to laminas/laminas-servicemanager; a new issue has been opened at laminas/laminas-servicemanager#5. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi there!
I would like to generate all proxies before app deployment (like doctrine has
orm:generate-proxies
). Some host services (like Heroku) require to do this during "compile" process. Sure, generate on-demain works, but there is many cases when cache is purge.The text was updated successfully, but these errors were encountered: