Plugin Directory

Changeset 428995


Ignore:
Timestamp:
08/26/2011 12:01:03 PM (15 years ago)
Author:
cybio
Message:
  • [NEW] "auto"-delete files older than cache time/cachecleanup
Location:
gravatarlocalcache/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gravatarlocalcache/trunk/GravatarLocalCache.php

    r298808 r428995  
    77Description: Local cache for gravatar images (saves dnsqueries and let you control cache/proxysettings of the images).
    88Author: Oliver Schaal
    9 Version: 1.0.2
     9Version: 1.1.0
    1010
    1111    This is a WordPress plugin (http://wordpress.org) and widget
     
    116116    <ul>
    117117            <?php
    118             // TODO: cache leeren
    119118            if (is_dir(GLCCACHEPATH)) {
     119                self::cleanupCache(GLCCACHEPATH);
    120120                $_filesInCache = self::filesInDirectory(GLCCACHEPATH);
    121121                $_fileInCacheCount = count($_filesInCache);
     
    321321                }
    322322            }
    323 
     323           
    324324            ?>
    325325<div class="wrap">
     
    358358    <ul style="padding-left:20px;">
    359359            <?php
    360             // TODO: cache leeren
    361360            if (is_dir(GLCCACHEPATH)) {
     361                self::cleanupCache(GLCCACHEPATH);
    362362                $_filesInCache = self::filesInDirectory(GLCCACHEPATH);
    363363                $_fileInCacheCount = count($_filesInCache);
     
    413413        }
    414414        /* showAdminMenu */
     415       
     416        /* cleanupCache */
     417        private static function cleanupCache ($path) {
     418            if ($handle = opendir($path)) {
     419                    while (false !== ($file = readdir($handle))) {
     420                            if ($file[0] == '.' || is_dir($path.'/'.$file)) {
     421                                    continue;
     422                            }
     423                            if ((time() - filemtime($path.'/'.$file)) > (self::$options['cache_time'] *60*60)) {
     424                                    unlink($path.'/'.$file);
     425                            }
     426                    }
     427                    closedir($handle);
     428            }           
     429        }
     430        /* cleanupCache */
    415431
    416432        /* array functions */
  • gravatarlocalcache/trunk/readme.txt

    r298808 r428995  
    99License: GPL v3, see LICENSE
    1010Requires at least: 2.8
    11 Tested up to: 3.0.0
    12 Stable tag: 1.0.2
     11Tested up to: 3.2.1
     12Stable tag: 1.1.0
    1313
    1414Local cache for gravatar images (saves dnsqueries and let you control cache/proxysettings of the images).
     
    2020Please report bugs and/or feature-request to our ticket-system: [Bugtracker/Wiki](http://trac.splash.de/glc).
    2121For Support, please use the [forum](http://board.splash.de/forumdisplay.php?f=105).
     22Latest development news: [Twitter](http://twitter.com/cybiox9).
    2223
    2324== Installation ==
     
    4243For other webservers you have to check the manual.
    4344
    44 For other questions, take a look at the [support forum](http://board.splash.de/forumdisplay.php?f=105).
     45For any further questions, please use the [support forum](http://board.splash.de/forumdisplay.php?f=105).
    4546
    4647== Changelog ==
     48
     49= 1.1.0 =
     50* [NEW] "auto"-delete files older than cache time/cachecleanup
    4751
    4852= 1.0.2 =
     
    6771
    6872= 0.9.3 (1.0.0 RC2) =
    69 * [NEW] wordpress settings for the default gravatar is now used
     73* [NEW] wordpress setting for the default gravatar is now used
    7074* [FIX] if there is a problem with the cache directory, some debug information will be displayed
    7175* [FIX] possible duplicate constant
Note: See TracChangeset for help on using the changeset viewer.