$paths = array_unique(array(Util_Rule::get_pgcache_rules_core_path(), Util_Rule::get_browsercache_rules_cache_path(), Util_Rule::get_browsercache_rules_no404wp_path())); ?> <?php foreach ($paths as $path) { if ($path) { ?> <li> <?php echo htmlspecialchars($path); ?> : <?php if (file_exists($path)) { ?> <?php if (Util_File::is_writable($path)) { ?> <code><?php _e('OK', 'w3-total-cache'); ?> </code> <?php } else { ?> <code><?php _e('Not write-able', 'w3-total-cache'); ?> </code> <?php } ?>
/** * Cehck if dir is write-able * * @param string $dir * @return boolean */ public static function is_writable_dir($dir) { $file = $dir . '/' . uniqid(mt_rand()) . '.tmp'; return Util_File::is_writable($file); }