File: MapController.php

package info (click to toggle)
icingaweb2-module-map 2.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 9,028 kB
  • sloc: javascript: 11,939; php: 1,207; sh: 54; makefile: 15
file content (32 lines) | stat: -rw-r--r-- 915 bytes parent folder | download | duplicates (2)
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();
    }
}