diff options
author | filip <filip.komar@gmail.com> | 2017-12-18 00:32:00 +0100 |
---|---|---|
committer | filip <filip.komar@gmail.com> | 2017-12-18 00:32:00 +0100 |
commit | 8424e4b54ab6b163d079094fc2db89c57761f0d7 (patch) | |
tree | c0cba9be6316ef32b4a4d931b114820fe8a1dcb6 /test/lang.php | |
parent | fa5e7ea6868b200ea56e577690f451605aa03691 (diff) | |
download | www-8424e4b54ab6b163d079094fc2db89c57761f0d7.tar www-8424e4b54ab6b163d079094fc2db89c57761f0d7.tar.gz www-8424e4b54ab6b163d079094fc2db89c57761f0d7.tar.bz2 www-8424e4b54ab6b163d079094fc2db89c57761f0d7.tar.xz www-8424e4b54ab6b163d079094fc2db89c57761f0d7.zip |
adding option for deleting feed and navigation cache:
option for deleting feed cache if blog posts are not parsed properly
option for deleting navigation cache if pages in one language are blank
or not parsed properly
Diffstat (limited to 'test/lang.php')
-rw-r--r-- | test/lang.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/lang.php b/test/lang.php index 33fc2e093..15e0ef28c 100644 --- a/test/lang.php +++ b/test/lang.php @@ -2,6 +2,42 @@ /** */ +function get($s){ + return (boolean) filter_input(INPUT_GET, $s, FILTER_SANITIZE_STRING); +} + +/* + * Option for deleting feed cache if blog posts are not parsed properly: + * https://www.mageia.org/test/lang.php?delete_feed_cache=1 + */ +$delete_feed_cache = get('delete_feed_cache'); +if ($delete_feed_cache) { + $feed_cache_patern = "../_nav/var/tmp/cache/*.spc"; + echo "Deleting feed cache!\n\n"; + array_map('unlink', glob($feed_cache_patern)); + + foreach (glob($feed_cache_patern) as $filename) { + echo "It seems that deleting feed cache didn't work as some files listed bellow are still there!\n\n"; + echo "$filename, uid: " . fileowner($filename) . "\n"; + } +} + +/* + * Option for deleting navigation cache if pages in one language are blank or not parsed properly: + * https://www.mageia.org/test/lang.php?delete_nav_cache=1 + */ +$delete_nav_cache = get('delete_nav_cache'); +if ($delete_nav_cache) { + $nav_cache_patern = "../_nav/var/tmp/cache/nav_lang_*.php"; + echo "Deleting navigation cache!\n\n"; + array_map('unlink', glob($nav_cache_patern)); + + foreach (glob($nav_cache_patern) as $filename) { + echo "It seems that deleting navigation cache didn't work as some files listed bellow are still there!\n\n"; + echo "$filename, uid: " . fileowner($filename) . "\n"; + } +} + include_once '../localeDetection.class.php'; include_once '../langs.inc.php'; |