public function getBreachManager($errorConfigFilePath, $loggingConfigFilePath, $elasticSearchConfigFilePath, $logDirPath) { $errorConfigManager = ErrorConfigManagerFactory::getInstance()->getManager($errorConfigFilePath); $slaConfigManager = new ConfigManager($errorConfigManager); $loggingConfigManager = LoggingConfigManagerFactory::getInstance()->getLoggingConfigManager($loggingConfigFilePath); $elasticSearchDao = ElasticSearchDaoFactory::getInstance()->getElasticSearchDao($elasticSearchConfigFilePath, 'newmonk_error'); $slackApiIncomingWebhookManager = SlackApiIncomingWebhookFactory::getInstance()->getManager(); $activityLogger = LoggerFactory::getInstance()->getFileLogger('ErrorSlaBreachManager', $logDirPath); return new BreachManager($slaConfigManager, $loggingConfigManager, $elasticSearchDao, $slackApiIncomingWebhookManager, $activityLogger); }
public function getChain($errorConfigFilePath) { if (empty($this->middlewareChainInstance)) { $middlewareConfig = ConfigFactory::getInstance()->getManager($errorConfigFilePath)->getConfigFor('middlewares'); $middlewares = []; foreach ($middlewareConfig as $middlewareConstructionParameters) { $reflector = new \ReflectionClass($middlewareConstructionParameters['class']); $middleware = $reflector->newInstanceArgs($middlewareConstructionParameters['parameters']); $middlewares[] = $middleware; } $this->middlewareChainInstance = new Chain($middlewares); } return $this->middlewareChainInstance; }