echo '</pre>'; } } echo createGoogleSitemap(); } else { echo 'Geen sitemaps gevonden'; } //productfeed if (PRODUCT_FEED_BESLIST == 'true') { tep_export('beslist'); } if (PRODUCT_FEED_KIESKEURIG == 'true') { tep_export('kieskeurig'); } //leegmaken cache $dir = DIR_FS_CATALOG . DIR_FS_CACHE; //cache dir if (is_dir($dir)) { reset_cache_dir($dir); } /********************************/ /* Optimize database tables */ /********************************/ $tables_query = tep_db_query('SHOW TABLES FROM ' . DB_DATABASE); while ($table = tep_db_fetch_row($tables_query)) { tep_db_query('OPTIMIZE TABLE ' . $table[0]); } /*sitemap update*/ tep_db_query('DELETE FROM `productspecs` WHERE `products_model` NOT IN (SELECT products_model FROM products)'); tep_db_query('DELETE FROM `specifications` where (hoofdkenmerk,subkenmerk) not in (SELECT hoofdkenmerk, subkenmerk from productspecs)'); require DIR_WS_INCLUDES . 'application_bottom.php';
function reset_cache_dir($dir) { if ($handle = opendir($dir)) { /* This is the correct way to loop over the directory. */ while (false !== ($file = readdir($handle))) { if (filetype($dir . $file) === 'dir' && $file != "." && $file != "..") { clearstatcache(); $dirs .= $file . "\n"; reset_cache_dir($dir . $file . '/'); } else { if (is_file($dir . $file)) { chmod($dir . $file, 0777); unlink($dir . $file); } } } closedir($handle); } }