1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
<?php
namespace Icinga\Module\Map\Web\Controller;
use Icinga\Application\Modules\Module;
use Icinga\Module\Map\ProvidedHook\Icingadb\IcingadbSupport;
use Icinga\Module\Map\Util\IcingadbUtils;
use Icinga\Module\Monitoring\Controller;
abstract class MapController extends Controller
{
/** @var bool whether icingadb is set as backend */
protected $isUsingIcingadb;
/** @var IcingadbUtils provide required icingadb utils */
protected $icingadbUtils;
/** @var string Pattern to check for broken coordinates */
protected $coordinatePattern = '/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/';
protected function moduleInit()
{
if (Module::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
$this->isUsingIcingadb = true;
$this->icingadbUtils = IcingadbUtils::getInstance();
return;
}
parent::moduleInit();
}
}
|