X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=4c3e4a8c0e835c630b338c1dc3677e731c6ae04a;hp=d910f8da2d136956ea73ca75feb66e755fc98666;hb=e8ca54fe91872ab95a6ffdc4f1268bf18889021d;hpb=7fb9bf8320c56b536a5cb7658f45823f013848f4 diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index d910f8da2d..4c3e4a8c0e 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1898,6 +1898,54 @@ function getCodeLength () { 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? @@ -2018,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] ?>