Example #1
0
 /**
  * Set up the test.
  */
 function setUp()
 {
     parent::setUp();
     // Configure WordPress with the test settings.
     wl_configure_wordpress_test();
     // Empty the blog.
     wl_empty_blog();
     // Empty the local cache.
     system('rm -rf ' . wl_caching_get_cache_folder());
 }
/**
 * Delete a cache file.
 *
 * @since 3.0.0
 *
 * @param string $filename The cache file to delete.
 */
function wl_caching_delete_file($filename)
{
    $cache_folder = wl_caching_get_cache_folder();
    if (file_exists($filename)) {
        unlink($filename);
    }
    // Delete folders contained in the cache folder - rmdir is safe: it doesn't delete non-empty folders.
    while (0 === strpos($filename = dirname($filename), $cache_folder)) {
        @rmdir($filename);
    }
}