/** * __invoke * * @param ContainerInterface $container * * @return null|\Reliv\Server\Entity\Environment * @throws \Exception */ public function __invoke(ContainerInterface $container) { $instance = \Reliv\Server\Environment::getInstance(); if (empty($instance)) { throw new \Exception('Reliv\\Server\\Environment MUST be build before configuration. No instance returned'); } return $instance; }
/** * getPattern * * @return string */ protected function getPattern() { $evn = \Reliv\Server\Environment::get('name', 'production'); return "{$this->path}/{$evn}/*.php"; }
/** * __invoke * * @param Request $request * @param Response $response * @param callable|Response $out * * @return mixed */ public function __invoke(Request $request, Response $response, callable $out = null) { $instance = \Reliv\Server\Environment::buildInstance($this->localConfigPath, $this->envName, $this->configKey); return $out($request, $response); }