get_all_supercache_filenames() WPSCache 1.0
Hooks from the function
Return
Null. Nothing.
Usage
get_all_supercache_filenames( $dir );
Code of get_all_supercache_filenames() get all supercache filenames WPSCache 1.7.1
function get_all_supercache_filenames( $dir = '' ) {
global $wp_cache_mobile_enabled, $cache_path;
$dir = wpsc_get_realpath( $dir );
if ( ! $dir ) {
wp_cache_debug( 'get_all_supercache_filenames: directory does not exist' );
return array();
}
if ( ! wpsc_is_in_cache_directory( $dir ) ) {
return array();
}
$filenames = array( 'index.html', 'index-https.html', 'index.html.php' );
if ( $dir != '' && isset( $wp_cache_mobile_enabled ) && $wp_cache_mobile_enabled ) {
// open directory and look for index-*.html files
if ( is_dir( $dir ) && $dh = @opendir( $dir ) ) {
while ( ( $file = readdir( $dh ) ) !== false ) {
if ( substr( $file, 0, 6 ) == 'index-' && strpos( $file, '.html' ) )
$filenames[] = $file;
}
closedir( $dh );
}
}
if ( function_exists( "apply_filters" ) ) {
$filenames = apply_filters( 'all_supercache_filenames', $filenames );
} else {
$filenames = do_cacheaction( 'all_supercache_filenames', $filenames );
}
foreach( $filenames as $file ) {
$out[] = $file;
$out[] = $file . '.gz';
}
return $out;
}