1
0
Fork 0
mirror of https://github.com/Findus23/matomo-DiagnosticsExtended.git synced 2024-09-18 14:53:45 +02:00
matomo-DiagnosticsExtended/Utils.php
2021-04-12 17:28:42 +02:00

44 lines
883 B
PHP

<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\DiagnosticsExtended;
class Utils
{
static function booleanIni(string $key): bool
{
return Utils::IniValueToBoolean(ini_get($key));
}
static function intIni(string $key): int
{
return (int)ini_get($key);
}
static function IniValueToBoolean(string $iniValue): bool
{
switch (strtolower($iniValue)) {
case "on":
case "true":
case "yes":
case "1":
return true;
case "off":
case "false":
case "no":
case "0":
case "":
return false;
default:
return $iniValue;
}
}
}