Example #1
0
function clean_iconcache($icon)
{
    $thumbs = array("140x185", "40x47", "30x40", "20x24");
    if ($icon instanceof steam_object) {
        $iconcache = get_icon_cache();
        $iconcache->remove($icon->get_id());
        $cache = get_icon_cache(3600);
        foreach ($thumbs as $icongroup) {
            $cache->remove("icon_id_" . $icon->get_id(), $icongroup);
        }
    }
}
Example #2
0
        } else {
            $data = array("content" => array());
            // array is considered an error
        }
    }
    return $data;
}
if (USE_DATABASE_DOWNLOAD && !$image_height && !$image_width && $login != 'guest' && !(isset($_GET["type"]) && ($_GET["type"] == "usericon" || $_GET["type"] == "objecticon"))) {
    $valid_database_call = TRUE;
    require "get_document_database.php";
} else {
    if (USE_DOCUMENT_CACHE && $login != 'guest' && isset($_GET["type"]) && ($_GET["type"] == "usericon" || $_GET["type"] == "objecticon")) {
        $image_width = isset($_GET["width"]) ? (int) $_GET["width"] : -1;
        $image_height = isset($_GET["height"]) ? (int) $_GET["height"] : -1;
        $DEBUG = FALSE;
        $cache = get_icon_cache(3600);
        $data = $cache->get("icon_" . $identifier_type . "_" . $identifier, $image_width . "x" . $image_height);
        // get the data or not in cache
        if (!isset($data) || !$data) {
            $data = get_document_data($login, $password, $identifier, $identifier_type, $image_width, $image_height);
            $cache->save($data, "icon_" . $identifier_type . "_" . $identifier, $image_width . "x" . $image_height);
        } else {
            if ($DEBUG) {
                error_log("cache hit for icon " . $identifier_type . "=" . $identifier . " " . $image_width . "x" . $image_height);
            }
        }
        $timestamp = $data["lastmodified"];
        if ($DEBUG) {
            error_log("calling conditional get for icon " . $identifier_type . "=" . $identifier . " timestamp=" . $timestamp);
        }
        // A PHP implementation of conditional get, see