summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorUrban Müller2022-04-20 17:04:41 +0200
committerUrban Müller2022-04-20 17:04:41 +0200
commit4ee2d3db26d1e84988a86ba72d7377130ed0efbe (patch)
treee0f9af61ee02039b3a0906fadfac7468442c5032 /it.class
parente0c40bb9b479b107a4b78f4b2073b132865d655f (diff)
downloaditools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.tar.gz
itools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.tar.bz2
itools-4ee2d3db26d1e84988a86ba72d7377130ed0efbe.zip
create generic it::servertype()
Diffstat (limited to 'it.class')
-rw-r--r--it.class12
1 files changed, 10 insertions, 2 deletions
diff --git a/it.class b/it.class
index 161893a..022db61 100644
--- a/it.class
+++ b/it.class
@@ -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');
}