Exemplo n.º 1
0
 /**
  * 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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 /**
  * 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'), '/');
 }