function walkdir($path, $exclusions, &$array) { global $root_length; $rs = @opendir($path); if (!$rs) { exit(3); } while ($file = readdir($rs)) { if ($file == '.' || $file == '..') { continue; } $current_path = "{$path}/{$file}"; if (is_excluded($current_path)) { continue; } $stat = stat($current_path); $group_entry = posix_getgrgid($stat['gid']); $user_entry = posix_getpwuid($stat['uid']); $group = $group_entry['name']; $user = $user_entry['name']; $relative_path = substr($current_path, $root_length + 1); $array[] = $relative_path . ';' . $stat['mode'] . ';' . $stat['nlink'] . ';' . $stat['uid'] . ';' . $user . ';' . $stat['gid'] . ';' . $group . ';' . $stat['size'] . ';' . $stat['atime'] . ';' . $stat['mtime'] . ';' . $stat['ctime']; if (is_dir($current_path)) { walkdir($current_path, $exclusions, $array); } } closedir($rs); }
function getFilesFromDir($dir, $exclude) { $files = array(); if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($dir . '/' . $file)) { $dir2 = $dir . '/' . $file; $files[] = getFilesFromDir($dir2, $exclude); } else { if (!is_excluded($dir, $file, $exclude)) { $GLOBALS["fileTxt"] .= $dir . '/' . $file; if ($GLOBALS["readContent"] == true) { $cont = file($dir . "/" . $file); $GLOBALS["fileContents"] .= implode("\n", $cont); $GLOBALS["md5s"][$dir . "/" . $file] = md5(implode("\n", $cont)); } $files[] = $dir . '/' . $file; } } } } closedir($handle); } return $files; }
function unregister_all_styles() { global $wp_styles; if (isset($wp_styles->queue) && is_array($wp_styles->queue)) { foreach ($wp_styles->queue as $style) { if (is_excluded($style)) { continue; } wp_dequeue_style($style); wp_deregister_style($style); } } }