Renamed function so it might be more understandable
[mailer.git] / inc / wrapper-functions.php
index dc9f9eff7c09fd8a28c2e4af41c3eae8198a0a38..4c3e4a8c0e835c630b338c1dc3677e731c6ae04a 100644 (file)
@@ -945,6 +945,13 @@ function setHttpStatus ($status) {
 
 // Getter for HTTP status
 function getHttpStatus () {
+       // Is the status set?
+       if (!isset($GLOBALS['http_status'])) {
+               // Abort here
+               debug_report_bug(__FUNCTION__, __LINE__, 'No HTTP status set!');
+       } // END - if
+
+       // Return it
        return $GLOBALS['http_status'];
 }
 
@@ -1855,6 +1862,90 @@ function getOneDay () {
        return $GLOBALS[__FUNCTION__];
 }
 
+// "Getter" for activate_xchange
+function getActivateXchange () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('activate_xchange');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for img_type
+function getImgType () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('img_type');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for code_length
+function getCodeLength () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('code_length');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for least_cats
+function getLeastCats () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('least_cats');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for pass_len
+function getPassLen () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('pass_len');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for admin_menu
+function getAdminMenu () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('admin_menu');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
+// "Getter" for last_month
+function getLastMonth () {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Determine it
+               $GLOBALS[__FUNCTION__] = getConfig('last_month');
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Checks wether proxy configuration is used
 function isProxyUsed () {
        // Do we have cache?
@@ -1975,5 +2066,13 @@ function ifUserPointsLocked ($userid) {
        return $GLOBALS[__FUNCTION__][$userid];
 }
 
+// Appends a line to an existing file or creates it instantly with given content.
+// This function does always add a new-line character to every line.
+function appendLineToFile ($file, $line) {
+       $fp = fopen($file, 'a') or debug_report_bug(__FUNCTION__, __LINE__, 'Cannot write to file ' . basename($file) . '!');
+       fwrite($fp, $line . "\n");
+       fclose($fp);
+}
+
 // [EOF]
 ?>