Beispiel #1
0
 /**
  * gets database name
  *
  * @param   \Dive\Connection\Connection $conn
  * @throws  DriverException
  * @return  string
  */
 public function getDatabaseName(Connection $conn)
 {
     $parsed = parse_url($conn->getDsn());
     if (isset($parsed['path'])) {
         return basename($parsed['path']);
     }
     throw new DriverException('Could not get database name');
 }