diff options
author | Urban Müller | 2022-04-20 17:04:41 +0200 |
---|---|---|
committer | Urban Müller | 2022-04-20 17:04:41 +0200 |
commit | 4ee2d3db26d1e84988a86ba72d7377130ed0efbe (patch) | |
tree | e0f9af61ee02039b3a0906fadfac7468442c5032 /it.class | |
parent | e0c40bb9b479b107a4b78f4b2073b132865d655f (diff) | |
download | itools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.tar.gz itools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.tar.bz2 itools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.zip |
create generic it::servertype()
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -368,7 +368,7 @@ static function _exit($p) */ static function is_live() { - return (preg_match("/^live/", $GLOBALS['ULTRASERVERTYPE']) || !$GLOBALS['ULTRASERVERTYPE'] || EDC('aslive')) && !EDC('asdevel'); + return it::servertype('live'); } @@ -378,7 +378,15 @@ static function is_live() */ static function is_devel() { - return (preg_match("/^devel/", $GLOBALS['ULTRASERVERTYPE']) || EDC('asdevel')) && !EDC('aslive'); + return it::servertype('devel'); +} + +/** + * Check if running on given server type(s) + */ +static function servertype($pattern) +{ + return it::match($pattern, $GLOBALS['ULTRASERVERTYPE'] ?: 'live'); } |