How to override a manager present in \Espo\Core\Container?
Collapse
X
-
Tags: None
-
yuri
Can you please add a way in espocrm?
All I expect is to create an object of the Manager class and keep it running.
Something like loadCustomManagers in Container class.
So here's the use case. I need errors reported immediately and I use sentry for that. Sentry reports errors immediately when it occurs through email with few lines of code.
composer.json
Code:{ "require": { "sentry/sentry": "1.9.0" } }
PHP Code:require_once __DIR__ . "/vendor/sentry/sentry/lib/Raven/Autoloader.php"; Raven_Autoloader::register(); $client = new Raven_Client($sentry-dsn); $client->setEnvironment("production"); $client->setAppPath("$appPath"); $client->setRelease(Raven_Client::VERSION); $client->install();
So, if I put this in a Manager and create an instance of manager having this code, it will start sending error reports to the email that is registered in sentry.Last edited by theBuzzyCoder; 02-05-2019, 06:52 AM.Comment
-
yuri,
You can also integrate sentry with monolog using
Comment
-
yuri
Hey, we have Custom Service Container which Is implemented for our sentry integration as mentioned above. The new release 6.0.9 have updates on
espocrm/application/Espo/Core/Container.php file where
Code:private function getLoader(string $name): ?Loader { $loaderClassName = $this->getLoaderClassName($name); if (!$loaderClassName) { return null; } return $this->injectableFactory->create($loaderClassName); }
How to override the espocrm/application/Espo/Core/Container.php class to customize the getLoader function?Last edited by Ananya K; 01-07-2021, 08:54 AM.Comment
-
esforim
Comment
Comment