[TEP-COMMIT] [CVS admin] clear the cache with the catalog caching class

anonymous-OfajU3CKLf1/[email protected] 9 Apr 2004 01:55:05 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in admin/admin on MAIN

cache.php +10 -16 1.23 -> 1.24

configuration.php +2 1.43 -> 1.44

+12 -16

2 modified files

clear the cache with the catalog caching class

----------

admin /admin

cache.php 1.23 -> 1.24

diff -u -r1.23 -r1.24
--- cache.php 2003/06/29 22:50:51 1.23
+++ cache.php 2004/04/09 01:55:02 1.24
@@ -23,8 +23,8 @@

}

// check if the cache directory exists

- if (is_dir(DIR_FS_CACHE)) {
- if (!is_writeable(DIR_FS_CACHE)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');

+ if (is_dir(DIR_FS_WORK)) {
+ if (!is_writeable(DIR_FS_WORK)) $messageStack->add(ERROR_CACHE_DIRECTORY_NOT_WRITEABLE, 'error');

} else {
$messageStack->add(ERROR_CACHE_DIRECTORY_DOES_NOT_EXIST, 'error');
}

@@ -71,33 +71,27 @@

</tr>
<?php
if ($messageStack->size < 1) {

- $languages = tep_get_languages();
-
- for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
- if ($languages[$i]['code'] == DEFAULT_LANGUAGE) {
- $language = $languages[$i]['directory'];
- }
- }
-

for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
$cached_file = ereg_replace('-language', '-' . $language, $cache_blocks[$i]['file']);

- if (file_exists(DIR_FS_CACHE . $cached_file)) {
- $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cached_file));
- } else {

+ if (file_exists(DIR_FS_WORK . $cached_file)) {
+ $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_WORK . $cached_file));
+ } elseif ($cache_blocks[$i]['multiple'] === true) {

$cache_mtime = TEXT_FILE_DOES_NOT_EXIST;

- $dir = dir(DIR_FS_CACHE);

+ $dir = dir(DIR_FS_WORK);

while ($cache_file = $dir->read()) {
$cached_file = ereg_replace('-language', '-' . $language, $cache_blocks[$i]['file']);

if (ereg('^' . $cached_file, $cache_file)) {

- $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_CACHE . $cache_file));

+ $cache_mtime = strftime(DATE_TIME_FORMAT, filemtime(DIR_FS_WORK . $cache_file));

break;
}
}

$dir->close();

+ } else {
+ $cache_mtime = TEXT_FILE_DOES_NOT_EXIST;

}
?>
<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">

@@ -110,7 +104,7 @@

}
?>
<tr>

- <td class="smallText" colspan="3"><?php echo TEXT_CACHE_DIRECTORY . ' ' . DIR_FS_CACHE; ?></td>

+ <td class="smallText" colspan="3"><?php echo TEXT_CACHE_DIRECTORY . ' ' . DIR_FS_WORK; ?></td>

</tr>
</table></td>
</tr>

----------

admin /admin

configuration.php 1.43 -> 1.44

diff -u -r1.43 -r1.44
--- configuration.php 2003/06/29 22:50:51 1.43
+++ configuration.php 2004/04/09 01:55:02 1.44
@@ -22,6 +22,8 @@

tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . tep_db_input($configuration_value) . "', last_modified = now() where configuration_id = '" . (int)$cID . "'");

+ osC_Cache::clear('configuration');
+

tep_redirect(tep_href_link(FILENAME_CONFIGURATION, 'gID=' . $HTTP_GET_VARS['gID'] . '&cID=' . $cID));
break;
}

CVSspam 0.2.8

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click