This commit is contained in:
Philipp Holzer 2019-03-01 12:01:28 +01:00
parent 0b6d3c71f9
commit b4a6e068a9
No known key found for this signature in database
GPG Key ID: 517BE60E2CE5C8A5
3 changed files with 12 additions and 7 deletions

View File

@ -113,10 +113,9 @@ class DBA
* @return string
* @throws \Exception
*/
public static function databaseName() {
$ret = self::p("SELECT DATABASE() AS `db`");
$data = self::toArray($ret);
return $data[0]['db'];
public static function databaseName()
{
return self::$db->getDatabaseName();
}
/**

View File

@ -38,7 +38,7 @@ interface IDatabase
* Returns the selected database name
* @return string
*/
function databaseName();
function getDatabaseName();
/**
* Check if data exists

View File

@ -194,9 +194,15 @@ class MysqlDatabase implements IDatabase, IDatabaseLock
return $this->serverInfo;
}
public function databaseName()
/**
* {@inheritdoc}
* @throws \Exception
*/
public function getDatabaseName()
{
return DBA::databaseName();
$ret = $this->p("SELECT DATABASE() AS `db`");
$data = $this->toArray($ret);
return $data[0]['db'];
}
public function exists($table, array $condition)