/** * Get the configuration array for a specific connection. * * @param string $connection The name of the connection. * * @return array * * @throws \InvalidArgumentException If connection is not defined */ public function getConnectionConfig($connection = null) { if ($connection === null) { $connection = $this->defaultConnection; } $config = $this->config->get("database.connections.{$connection}"); if (!$config) { if (!is_string($connection)) { $connection = gettype($connection); } throw new \InvalidArgumentException("No config found for connection: {$connection}"); } return $config; }
protected function getSessionPath() { if ($this->config->has('path.session')) { return $this->config->get('path.session'); } if ($this->config->has('path.storage')) { return $this->config->get('path.storage') . '/session'; } return null; }
protected function getLogDirectory() { if ($this->config->has('path.logs')) { return $this->config->get('path.logs'); } if ($this->config->has('path.storage')) { $path = $this->config->get('path.storage') . '/logs'; if (is_dir($path)) { return $path; } } return null; }
/** * Make the session object. * * @return \Symfony\Component\HttpFoundation\Session\Session */ public function makeSession() { $session = new Session($this->dic->resolve('Symfony\\Component\\HttpFoundation\\Session\\Storage\\SessionStorageInterface'), $this->dic->resolve('Symfony\\Component\\HttpFoundation\\Session\\Attribute\\AttributeBagInterface'), $this->dic->resolve('Symfony\\Component\\HttpFoundation\\Session\\Flash\\FlashBagInterface')); $session->setName($this->config->get('session.cookie.name', 'autarky_session')); return $session; }
/** * {@inheritdoc} */ public function configure() { $this->router->mount($this->config->get('routes'), '/'); }