X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fwrapper-functions.php;h=281a5b1634b883f2ae546f4b1f95051d1c486542;hb=e9da1508b2a3ccbf63adc999981674740a47e074;hp=e20a4abd2139350827cf4f5e69ec2794cb233cc5;hpb=87229cb5d7b5396793e85fd0b4172d473195835c;p=mailer.git diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index e20a4abd21..281a5b1634 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -10,13 +10,8 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Wrapper-Funktionen * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2013 by Mailer Developer Team * + * Copyright (c) 2009 - 2015 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -1004,6 +999,9 @@ function setAdminMd5 ($adminMd5) { // Set session $status = setSession('admin_md5', $adminMd5); + // Remove cache to get correct results + unset($GLOBALS['isAdmin']); + // Return status return $status; } @@ -1421,30 +1419,6 @@ function encodeEntities ($str) { return $str; } -// "Getter" for date from patch_ctime -function getDateFromRepository () { - // Is it cached? - if (!isset($GLOBALS[__FUNCTION__])) { - // Then set it - $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '5'); - } // END - if - - // Return cache - return $GLOBALS[__FUNCTION__]; -} - -// "Getter" for date/time from patch_ctime -function getDateTimeFromRepository () { - // Is it cached? - if (!isset($GLOBALS[__FUNCTION__])) { - // Then set it - $GLOBALS[__FUNCTION__] = generateDateTime(getConfig('CURRENT_REPOSITORY_DATE'), '2'); - } // END - if - - // Return cache - return $GLOBALS[__FUNCTION__]; -} - // Getter for current year (default) function getYear ($timestamp = NULL) { // Is it cached? @@ -1793,6 +1767,18 @@ function getCachePath () { return $GLOBALS[__FUNCTION__]; } +// "Getter" for cache_extension +function getCacheExtension () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('CACHE_EXTENSION'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // "Getter" for WRITE_FOOTER function getWriteFooter () { // Is there cache? @@ -1901,6 +1887,18 @@ function getTableType () { return $GLOBALS[__FUNCTION__]; } +// "Getter" for db_type +function getDbType () { + // Is there cache? + if (!isset($GLOBALS[__FUNCTION__])) { + // Determine it + $GLOBALS[__FUNCTION__] = getConfig('_DB_TYPE'); + } // END - if + + // Return cache + return $GLOBALS[__FUNCTION__]; +} + // "Getter" for salt_length function getSaltLength () { // Is there cache? @@ -1949,18 +1947,6 @@ function getTitle () { return $GLOBALS[__FUNCTION__]; } -// "Getter" for curr_svn_revision -function getCurrentRepositoryRevision () { - // Is there cache? - if (!isset($GLOBALS[__FUNCTION__])) { - // Determine it - $GLOBALS[__FUNCTION__] = getConfig('CURRENT_REPOSITORY_REVISION'); - } // END - if - - // Return cache - return $GLOBALS[__FUNCTION__]; -} - // "Getter" for server_url function getServerUrl () { // Is there cache? @@ -3578,5 +3564,26 @@ function convertApiResponseToArray ($responseString, $keyDelimiter, $valueDelimi return $returned; } +// Getter for full (generic) hash file name +function getGenericHashFileName () { + // Return result + return sprintf('%s%s.%s%s', getPath(), getCachePath(), getFileHash(), getCacheExtension()); +} + +// "Compiles" the given value and sets it in given key +function setSessionCompiled ($key, $value) { + // Debug message + //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key[]=' . gettype($key) . ',value[]=' . gettype($value)); + + // Is the value not an array? + if (!is_array($value)) { + // "Compile" the value + $value = doFinalCompilation(compileRawCode($value)); + } // END - if + + // And set it + return setSession($key, $value); +} + // [EOF] ?>