From 28d2461a2288bfe7dca2907e471303e230c99b52 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 7 Mar 2009 03:53:29 +0000 Subject: [PATCH] Missing cache loader added from stelzi's branch --- DOCS/TODOs.txt | 24 ++++++----- inc/loader/load_cache-config.php | 2 - inc/loader/load_cache-revision.php | 64 ++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 inc/loader/load_cache-revision.php diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 2d5c0b5dfa..45c32b2da6 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -8,16 +8,17 @@ ./inc/functions.php:1303: // @TODO Remove this if() block if all is working fine ./inc/functions.php:1603: // @TODO This can be, somehow, rewritten ./inc/functions.php:2330:// @TODO Rewrite all language constants to this function. -./inc/functions.php:2563: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? -./inc/functions.php:2565: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? +./inc/functions.php:2579: $GLOBALS['cache_instance']->destroyCacheFile(); // @TODO isn't it better to do $GLOBALS['cache_instance']->destroyCacheFile('revision')? +./inc/functions.php:2581: // @TODO shouldn't do the unset and the reloading $GLOBALS['cache_instance']->destroyCacheFile() Or a new methode like forceCacheReload('revision')? ./inc/functions.php:259: // @TODO Fine all templates which are using these direct variables and rewrite them. ./inc/functions.php:260: // @TODO After this step is done, this else-block is history -./inc/functions.php:2712: // @TODO Add a little more infos here -./inc/functions.php:2722: // @TODO This cannot be rewritten to mxchange_die(), try to find a solution for this. -./inc/functions.php:2819:// @TODO Implement $compress -./inc/functions.php:2826:// @TODO Implement $decompress -./inc/functions.php:2929: // @TODO We may want to switch over to UTF-8 here! -./inc/functions.php:2937:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() +./inc/functions.php:2658: // @TODO What does this loop/regex do? Document it, please. +./inc/functions.php:2751: // @TODO Add a little more infos here +./inc/functions.php:2761: // @TODO This cannot be rewritten to mxchange_die(), try to find a solution for this. +./inc/functions.php:2858:// @TODO Implement $compress +./inc/functions.php:2865:// @TODO Implement $decompress +./inc/functions.php:2968: // @TODO We may want to switch over to UTF-8 here! +./inc/functions.php:2976:// @TODO Rewrite this function to use READ_FILE() and WRITE_FILE() ./inc/functions.php:475:// @TODO Rewrite this to an extension 'smtp' ./inc/language/rallye_de.php:110:// @TODO Rewrite following two lines to one ./inc/language/sponsor_de.php:124:// @TODO These three constants should be moved into a template @@ -27,7 +28,7 @@ ./inc/libs/nickname_functions.php:59: // @TODO Can we replace this with GET_TOTAL_DATA() ? ./inc/libs/rallye_functions.php:635: $EXPIRE = getConfig('one_day') * 3; // @TODO The hard-coded value... ./inc/libs/rallye_functions.php:665: // @TODO Rewrite this to a function -./inc/libs/rallye_functions.php:704: // @TODO Rewrite this to our API function +./inc/libs/rallye_functions.php:702: // @TODO Rewrite this to our API function ./inc/libs/register_functions.php:53: // @TODO Rewrite these constants ./inc/libs/surfbar_functions.php:1425: // @TODO This can be somehow rewritten ./inc/libs/surfbar_functions.php:917: // @TODO Invalid salt should be refused @@ -37,7 +38,6 @@ ./inc/libs/user_functions.php:335: // @TODO Make this filter working: $URL = runFilterChain('do_login', array('uid' => $uid, 'hash' => $hash, 'addon' => $ADDON)); ./inc/libs/user_functions.php:370: // @TODO Can this query be merged with above query? ./inc/libs/yoomedia_functions.php:65: $response = YOOMEDIA_QUERY_API("out_textmail.php", true); // @TODO Ask Yoo!Media for test script -./inc/loader/load_cache-config.php:50: // @TODO: Do we really need to cache the config??? ./inc/load_extensions.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php * ./inc/mails/birthday_mails.php:85: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/modules/admin/admin-inc.php:343: // @TODO Rewrite this to $content = SQL_FETCHARRAY() @@ -133,7 +133,9 @@ ./inc/modules/admin/what-usr_online.php:107: // @TODO Rewrite this constant ./inc/modules/admin/what-usr_online.php:51: // @TODO Rewrite these constants ./inc/modules/admin/what-usr_online.php:52: // @TODO Add a filter for sponsor -./inc/modules/guest/what-mediadata.php:183:// @TODO Rewrite these all if-blocks to filters +./inc/modules/guest/what-mediadata.php:186:// @TODO Rewrite these all if-blocks to filters +./inc/modules/guest/what-mediadata.php:49:// @TODO Rewrite all constants +./inc/modules/guest/what-mediadata.php:69: // @TODO Find a better formular than this one ./inc/modules/guest/what-register.php:201: // @TODO Rewrite this to a single filter ./inc/modules/guest/what-sponsor_infos.php:67: // @TODO Rewritings: conv->conv_rate,name->conv_name in template ./inc/modules/guest/what-sponsor_infos.php:87: // @TODO Rewritings: name->pay_name,min->pay_min_count,min->pay_min_count,curr->pay_currency diff --git a/inc/loader/load_cache-config.php b/inc/loader/load_cache-config.php index 84af342457..49402d59d2 100644 --- a/inc/loader/load_cache-config.php +++ b/inc/loader/load_cache-config.php @@ -46,8 +46,6 @@ if (!defined('__SECURITY')) { if (($GLOBALS['cache_instance']->loadCacheFile("config", true)) && ($GLOBALS['cache_instance']->extensionVersionMatches("sql_patches"))) { // Load config from cache $GLOBALS['cache_array']['config'] = $GLOBALS['cache_instance']->getArrayFromCache(); - - // @TODO: Do we really need to cache the config??? } elseif ((getConfig('cache_config') == "Y") && ($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) { // Create cache file here $GLOBALS['cache_instance']->init("CONFIG"); diff --git a/inc/loader/load_cache-revision.php b/inc/loader/load_cache-revision.php new file mode 100644 index 0000000000..dfe402db10 --- /dev/null +++ b/inc/loader/load_cache-revision.php @@ -0,0 +1,64 @@ +loadCacheFile("revision", true))) { + // Load revision from cache + $GLOBALS['cache_array']['revision'] = $GLOBALS['cache_instance']->getArrayFromCache(); +} elseif (($GLOBALS['output_mode'] != "1") && ($GLOBALS['output_mode'] != "-1")) { + // Create cache file here + $GLOBALS['cache_instance']->init("REVISION"); + + // add the new RevInfos in and saves it to the cache + $GLOBALS['cache_instance']->addRow(getAkt_vers()); + + // Close the cache + $GLOBALS['cache_instance']->finalize(); + + // Include loader again + require(__FILE__); +} + +// +?> -- 2.30.2