mirror of
https://github.com/Findus23/matomo-DiagnosticsExtended.git
synced 2024-09-10 05:33:45 +02:00
44 lines
883 B
PHP
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;
|
|
}
|
|
}
|
|
|
|
}
|