Opened 9 years ago
Last modified 9 years ago
#1201 closed Bug/Fehler
Fehler bei Cache löschen — at Version 7
| Reported by: | Ronald Parcinski | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.3.0 |
| Component: | Admin | Version: | 2.0.2.2 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description (last modified by )
Cache Löschfunktion im Backend löscht die .htaccess und index.html im cache Verzeichnis
Change History (7)
comment:1 by , 9 years ago
comment:2 by , 9 years ago
Nicht Cache leeren sondern abspeichern mit Einstellung DB_CACHE = false löscht die Dateien
comment:3 by , 9 years ago
Na dann:
Suche:
// DB Cache System [If Cache deactivated.. clean all cachefiles]
if (isset($_POST['DB_CACHE']) && $_POST['DB_CACHE'] == 'false') {
$handle = opendir(SQL_CACHEDIR);
while (($file = readdir($handle)) !== false) {
// Jump over files that are no sql-cache
if (strpos($file, 'sql_') !== false) continue;
@unlink(SQL_CACHEDIR.$file);
}
}
Und ersetze mit:
// DB Cache System [If Cache deactivated.. clean all cachefiles]
if ((isset($_POST['USE_CACHE']) && $_POST['USE_CACHE'] == 'false') || (isset($_POST['DB_CACHE']) && $_POST['DB_CACHE'] == 'false')) {
clear_dir(DIR_FS_CATALOG.'cache/');
//$messageStack->add_session(DELETE_CACHE_SUCCESSFUL, 'success'); // Optional gleich Erfolgsmeldung mit ausgeben?
}
comment:4 by , 9 years ago
Nein, laut Code sollen nur SQL Cache (DB_CACHE) Dateien gelöscht werden (Wobei bei mir im Testshop mit DB_CACHE an keine sql_ Dateien angelegt werden, sondern nur Dateien mit .txt Endung.
comment:5 by , 9 years ago
Das Caching wurde doch von Gerhard komplett überarbeitet. Es gibt keine Dateien mehr, die mit "sql_*" beginnen.
comment:7 by , 9 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | fixed |
| Status: | closed → reopened |
Es muss noch geklärt werden wie nur die SQL Cache Datein gelöscht werden.
Man kann sie wohl an der .txt Endung erkennen.
Erkennung anhand von 'sql_' funktioniert ja wohl nicht mehr.

Kann ich nicht nachvollziehen.
Der Aufruf erfolgt aus der "/admin/configuration.php":
case 'delcache': clear_dir(DIR_FS_CATALOG.'cache/'); $messageStack->add_session(DELETE_CACHE_SUCCESSFUL, 'success'); xtc_redirect(xtc_href_link(FILENAME_CONFIGURATION, 'gID=' . (int)$_GET['gID'])); break;Die Funktion clear_dir() steckt in der "/admin/includes/functions.php" und arbeitet wie sie soll:
/** * clear_dir() * * @param string $dir * @param boolean $basefiles */ function clear_dir($dir, $basefiles = false) { if ($basefiles === true) { $files = glob(rtrim($dir, '/').'/{,.}[!.,!..]*', GLOB_BRACE); } else { $files = glob(rtrim($dir, '/').'/*'); } foreach ($files as $file) { if(is_dir($file)) { clear_dir($file, true); rmdir($file); } else { if ($basefiles === false && basename($file) != 'index.html') { unlink($file); } elseif ($basefiles === true) { unlink($file); } } } }