Changeset 1369 for plugins

Show
Ignore:
Timestamp:
11/27/08 21:04:13 (6 weeks ago)
Author:
MattRead
Message:

staticcache: use alias() and clear hits/misses on "clear cache data"

Location:
plugins/staticcache/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • plugins/staticcache/trunk/dash_module_staticcache.php

    r1269 r1369  
    2727                        spinner.stop(); 
    2828                        humanMsg.displayMsg( json ); 
     29                        $('.static-cache-module .item .pct20').each(function() { 
     30                            $(this).html('0');  
     31                        }); 
    2932                    }, 
    3033                    'json' 
  • plugins/staticcache/trunk/staticcache.plugin.php

    r1269 r1369  
    2323            'action_init' => 1 
    2424            ); 
     25    } 
     26     
     27    public function alias() 
     28    { 
     29        return array( 
     30            'action_post_update_after' => array( 
     31                'action_post_insert_after', 
     32                'action_post_delete_after' 
     33            ), 
     34            'action_comment_update_after' => array( 
     35                'action_comment_insert_after', 
     36                'action_comment_delete_after' 
     37            ) 
     38        ); 
    2539    } 
    2640     
     
    108122            Cache::expire( array('staticcache', $name) ); 
    109123        } 
     124        Options::set('staticcache__hits', 0); 
     125        Options::set('staticcache__misses', 0); 
     126        Options::set('staticcache__average_time', 0); 
    110127        echo json_encode("Cleared Static Cache's cache"); 
    111128    } 
    112129     
    113     public function cache_invalidate( $urls ) 
     130    public function cache_invalidate( array $urls ) 
    114131    { 
    115132        // account for annonymous user (id=0) 
     
    127144    } 
    128145     
    129     public function action_post_insert_after( $post ) 
    130     { 
    131         $this->action_post_update_after( $post ); 
    132     } 
    133      
    134     public function action_post_delete_after( $post ) 
    135     { 
    136         $this->action_post_update_after( $post ); 
    137     } 
    138      
    139     public function action_post_update_after( $post ) 
     146    public function action_post_update_after( Post $post ) 
    140147    { 
    141148        $urls = array( 
     
    148155    } 
    149156     
    150     public function action_comment_insert_after( $comment ) 
    151     { 
    152         $this->action_comment_update_after( $comment ); 
    153     } 
    154      
    155     public function action_comment_delete_after( $comment ) 
    156     { 
    157         $this->action_comment_update_after( $comment ); 
    158     } 
    159      
    160     public function action_comment_update_after( $comment ) 
     157    public function action_comment_update_after( Comment $comment ) 
    161158    { 
    162159        $urls = array(