mirror of
https://github.com/Icinga/docker-icingaweb2.git
synced 2025-10-23 13:00:59 +02:00
DbCommand: support PHP 8.2
by not creating dynamic properties.
This commit is contained in:
parent
d07b4af99f
commit
15489dfcc9
@ -47,16 +47,16 @@ class DbCommand extends Command
|
|||||||
|
|
||||||
public function initializedAction()
|
public function initializedAction()
|
||||||
{
|
{
|
||||||
echo (int) (array_search('icingaweb_group', $this->getDb()->listTables(), true) !== false);
|
echo (int) (array_search('icingaweb_group', $this->getDb()->conn->listTables(), true) !== false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initAction()
|
public function initAction()
|
||||||
{
|
{
|
||||||
$db = $this->getDb();
|
$db = $this->getDb();
|
||||||
|
|
||||||
$db->import(
|
$db->conn->import(
|
||||||
Config::module('setup')
|
Config::module('setup')
|
||||||
->get('schema', 'path', Icinga::app()->getBaseDir('schema')) . "/{$db->dbType}.schema.sql"
|
->get('schema', 'path', Icinga::app()->getBaseDir('schema')) . "/{$db->type}.schema.sql"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class DbCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return DbTool
|
* @return \stdClass
|
||||||
*/
|
*/
|
||||||
protected function getDb()
|
protected function getDb()
|
||||||
{
|
{
|
||||||
@ -111,7 +111,10 @@ class DbCommand extends Command
|
|||||||
|
|
||||||
$db = new DbTool($config);
|
$db = new DbTool($config);
|
||||||
$db->connectToDb();
|
$db->connectToDb();
|
||||||
$db->dbType = $type;
|
|
||||||
return $db;
|
return (object) [
|
||||||
|
'conn' => $db,
|
||||||
|
'type' => $type
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user