protected static function setHeight() { $sum = 0; foreach (static::$_robots as $value) { $sum += $value->getHeight(); } static::$height = $sum; }
/** Parses the GET parameter. @return null. **/ public static function parsArgs() { if (static::$parsed) { return; } static::$parsed = true; $shortopts = ""; $longopts = array("host:", "service:", "command:", "perf_label:", "request:"); $args = getopt($shortopts, $longopts); $input = file_get_contents('php://input'); if (!empty($input)) { // @codeCoverageIgnore static::$request = json_decode($input, true); // @codeCoverageIgnore } elseif (isset($args['request']) && !empty($args['request'])) { // @codeCoverageIgnore static::$request = json_decode($args['request'], true); // @codeCoverageIgnore } // @codeCoverageIgnore if (!static::$request) { if (isset($_GET['host']) && !empty($_GET['host'])) { define("HOST", $_GET["host"]); } elseif (isset($args['host']) && !empty($args['host'])) { define("HOST", $args["host"]); // @codeCoverageIgnore } else { // @codeCoverageIgnore \histou\Basic::returnData('Hostname is missing!', 1, 'Hostname is missing!'); } if (isset($_GET['service']) && !empty($_GET['service'])) { define("SERVICE", $_GET["service"]); } elseif (isset($args['service']) && !empty($args['service'])) { define("SERVICE", $args["service"]); // @codeCoverageIgnore } else { // @codeCoverageIgnore define("SERVICE", HOSTCHECK_ALIAS); } if (isset($_GET['command']) && !empty($_GET['command'])) { define("COMMAND", $_GET["command"]); } elseif (isset($args['command']) && !empty($args['command'])) { define("COMMAND", $args["command"]); // @codeCoverageIgnore } // @codeCoverageIgnore if (isset($_GET['perf_label']) && !empty($_GET['perf_label'])) { global $PERF_LABEL; $PERF_LABEL = $_GET["perf_label"]; } elseif (isset($args['perf_label']) && !empty($args['perf_label'])) { global $PERF_LABEL; $PERF_LABEL = $args["perf_label"]; // @codeCoverageIgnore } // @codeCoverageIgnore if (isset($PERF_LABEL) && !is_array($PERF_LABEL)) { $PERF_LABEL = array($PERF_LABEL); } } if (isset($_GET['disablePanelTitel'])) { static::$disablePanelTitel = true; } if (isset($_GET['debug'])) { \histou\Debug::enable(); } if (isset($_GET['height']) && !empty($_GET['height'])) { static::$height = $_GET["height"]; } if (isset($_GET['legend']) && !empty($_GET['legend']) && $_GET["legend"] == "false") { define("SHOW_LEGEND", false); } else { define("SHOW_LEGEND", true); } if (isset($_GET['annotations']) && !empty($_GET['annotations']) && $_GET["annotations"] == "true") { define("SHOW_ANNOTATION", true); } else { define("SHOW_ANNOTATION", false); } if (isset($_GET['specificTemplate']) && !empty($_GET['specificTemplate'])) { static::$specificTemplate = $_GET["specificTemplate"]; } if (static::$specificTemplate != "" && isset($_GET['disablePerfdataLookup'])) { static::$disablePerfdataLookup = true; } }
public static function setHeight($var) { static::$height = $var; }