/** * Execute the shutdown procedure. * * @return void */ public function shutdown() { if ($this->connection !== null) { $this->connection = null; } if ($this->_doctrineConnection !== null) { $this->_doctrineConnection->getManager()->closeConnection($this->_doctrineConnection); } }
/** Returns the name of the Doctrine database. * * @throws RuntimeException If the active connection has no DSN. * @return string */ protected function getDatabaseName() { /* Why oh why does Doctrine_Connection not do this for us? */ /** @noinspection PhpVoidFunctionResultUsedInspection */ if (!($dsn = $this->_connection->getOption('dsn'))) { throw new RuntimeException(sprintf('Doctrine connection "%s" does not have a DSN!', $this->_connection->getName())); } $info = $this->_connection->getManager()->parsePdoDsn($dsn); return isset($info['dbname']) ? $info['dbname'] : null; }