wp_cache_regenerate_cache_file_stats()
No Hooks.
Return
null
. Nothing (null).
Usage
wp_cache_regenerate_cache_file_stats();
wp_cache_regenerate_cache_file_stats() wp cache regenerate cache file stats code WPSCache 1.12.4
function wp_cache_regenerate_cache_file_stats() { global $cache_compression, $supercachedir, $file_prefix, $wp_cache_preload_on, $cache_max_time; if ( $supercachedir == '' ) $supercachedir = get_supercache_dir(); $sizes = wpsc_generate_sizes_array(); $now = time(); if (is_dir( $supercachedir ) ) { if ( $dh = opendir( $supercachedir ) ) { while ( ( $entry = readdir( $dh ) ) !== false ) { if ( $entry != '.' && $entry != '..' ) { $sizes = wpsc_dirsize( trailingslashit( $supercachedir ) . $entry, $sizes ); } } closedir( $dh ); } } foreach( $sizes as $cache_type => $list ) { foreach( array( 'cached_list', 'expired_list' ) as $status ) { $cached_list = array(); foreach( $list[ $status ] as $dir => $details ) { if ( $details[ 'files' ] == 2 && !isset( $details[ 'upper_age' ] ) ) { $details[ 'files' ] = 1; } $cached_list[ $dir ] = $details; } $sizes[ $cache_type ][ $status ] = $cached_list; } } if ( $cache_compression ) { $sizes[ 'supercache' ][ 'cached' ] = intval( $sizes[ 'supercache' ][ 'cached' ] / 2 ); $sizes[ 'supercache' ][ 'expired' ] = intval( $sizes[ 'supercache' ][ 'expired' ] / 2 ); } $cache_stats = array( 'generated' => time(), 'supercache' => $sizes[ 'supercache' ], 'wpcache' => $sizes[ 'wpcache' ] ); update_option( 'supercache_stats', $cache_stats ); return $cache_stats; }