Exemplo n.º 1
0
 function __perform_update_cache_batch()
 {
     if ($this->_batchlimit > 0) {
         $results = fetch_file_cache_new_item_attribute_rs();
         if ($results) {
             while ($item_attribute_r = db_fetch_assoc($results)) {
                 // if URL happens to have been inserted by someone else before we get to the current
                 // row, then this function will do nothing, and thats ok.
                 if (file_cache_insert_file($item_attribute_r['attribute_val'], NULL, NULL, NULL, 'ITEM', FALSE)) {
                     $this->_processed++;
                 } else {
                     $this->_failures++;
                 }
                 // don't process anymore this time around.
                 if ($this->_processed >= $this->_batchlimit) {
                     break;
                 }
             }
             db_free_result($results);
         }
     }
     $this->_remaining = fetch_file_cache_new_item_attribute_cnt();
 }
Exemplo n.º 2
0
            //file_cache_delete_orphan_item_cache();
            file_cache_delete_orphans($HTTP_VARS['cache_type']);
            $HTTP_VARS['op'] = '';
        } else {
            if ($HTTP_VARS['confirmed'] != 'false') {
                echo "\n<h3>Delete Orphaned Cache files</h3>";
                echo get_op_confirm_form($PHP_SELF, "Are you sure you want to delete cache files?", array('type' => $ADMIN_TYPE, 'op' => 'delete'));
            } else {
                $HTTP_VARS['op'] = '';
            }
        }
    }
}
if ($HTTP_VARS['op'] == '') {
    echo "<p>";
    if (fetch_file_cache_new_item_attribute_cnt() > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=update\">Update</a>] ";
    }
    if (fetch_file_cache_refresh_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=refresh\">Refresh</a>] ";
    }
    if (fetch_file_cache_missing_thumbs_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=job&job=refresh_thumbnails\">Refresh Thumbnails</a>] ";
    }
    // the item attribute orphan count is really slow, so do not use it.
    if (fetch_file_cache_missing_file_cnt('ITEM') > 0) {
        echo "[<a href=\"admin.php?type={$ADMIN_TYPE}&op=delete\">Delete Orphans</a>] ";
    }
    echo "</p>";
    if (strlen($HTTP_VARS['order_by']) == 0) {
        $HTTP_VARS['order_by'] = 'cache_date';