summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian Weber2009-01-29 15:56:19 +0000
committerChristian Weber2009-01-29 15:56:19 +0000
commitd2ba50a32fbd58595f0fc4c2a215922877b45776 (patch)
tree60fc3cfc87d0d6ce8541151eee2aa7f9bdb23e79 /it.class
parent18470949be741f34b4bd31e475aa7ab42fb01e42 (diff)
downloaditools-d2ba50a32fbd58595f0fc4c2a215922877b45776.tar.gz
itools-d2ba50a32fbd58595f0fc4c2a215922877b45776.tar.bz2
itools-d2ba50a32fbd58595f0fc4c2a215922877b45776.zip
add it::is_devel() and it::is_live() as abstraction for $GLOBALS['ULTRASERVERTYPE']
Diffstat (limited to 'it.class')
-rw-r--r--it.class20
1 files changed, 20 insertions, 0 deletions
diff --git a/it.class b/it.class
index 2cb625b..81cdf01 100644
--- a/it.class
+++ b/it.class
@@ -251,6 +251,26 @@ function bail($message = "Bailed.\n")
/**
+ * Check wether I am on a live server for this service. Honors 'aslive' and 'asdevel' debug vars
+ * @return true if servertype is 'live'
+ */
+function is_live()
+{
+ return (preg_match("/^live/", $GLOBALS['ULTRASERVERTYPE']) || EDC('aslive')) && !EDC('asdevel');
+}
+
+
+/**
+ * Check wether I am on a development server for this service. Honors 'aslive' and 'asdevel' debug vars
+ * @return true if servertype is 'devel'
+ */
+function is_devel()
+{
+ return (preg_match("/^devel/", $GLOBALS['ULTRASERVERTYPE']) || EDC('asdevel')) && !EDC('aslive');
+}
+
+
+/**
* Convert a string to ASCII-only chars, map/strip ISO-8859-1 accents
* @param $text Text to convert
* @return mapped/stripped version of $text contains only chars [0..127]