mirror of
https://github.com/Icinga/icingaweb2-module-graphite.git
synced 2026-06-09 08:51:21 -04:00
Introduce class IcingadbUtils
This singleton class includes all required icingadb trailts
This commit is contained in:
parent
2915e4a4d2
commit
66cf97c171
1 changed files with 49 additions and 0 deletions
49
library/Graphite/Util/IcingadbUtils.php
Normal file
49
library/Graphite/Util/IcingadbUtils.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/* Icinga Graphite Web | (c) 2022 Icinga GmbH | GPLv2 */
|
||||
|
||||
namespace Icinga\Module\Graphite\Util;
|
||||
|
||||
use Icinga\Module\Icingadb\Common\Auth;
|
||||
use Icinga\Module\Icingadb\Common\Database;
|
||||
use Icinga\Module\Icingadb\Common\Macros;
|
||||
|
||||
/**
|
||||
* Class for initialising icingadb utils
|
||||
*/
|
||||
class IcingadbUtils
|
||||
{
|
||||
use Macros;
|
||||
use Database;
|
||||
use Auth;
|
||||
|
||||
protected static $instance;
|
||||
|
||||
/**
|
||||
* @see getInstance()
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the IcingadbUtils instance
|
||||
*
|
||||
* @return IcingadbUtils
|
||||
*/
|
||||
public static function getInstance(): IcingadbUtils
|
||||
{
|
||||
if (self::$instance === null) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return static::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the instance from being cloned (which would create a second instance of it)
|
||||
*/
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue