本文整理汇总了PHP中DUP_Util::ListFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP DUP_Util::ListFiles方法的具体用法?PHP DUP_Util::ListFiles怎么用?PHP DUP_Util::ListFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DUP_Util
的用法示例。
在下文中一共展示了DUP_Util::ListFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFiles
private function getFiles()
{
foreach ($this->Dirs as $key => $val) {
$files = DUP_Util::ListFiles($val);
foreach ($files as $filePath) {
$fileName = basename($filePath);
if (!is_dir($filePath)) {
if (!in_array(@pathinfo($filePath, PATHINFO_EXTENSION), $this->FilterExtsAll)) {
//Unreadable
if (!is_readable($filePath)) {
$this->FilterInfo->Files->Unreadable[] = $filePath;
continue;
}
$fileSize = @filesize($filePath);
$fileSize = empty($fileSize) ? 0 : $fileSize;
$invalid_test = strlen($filePath) > 250 || preg_match('/(\\/|\\*|\\?|\\>|\\<|\\:|\\|\\|)/', $fileName) || trim($fileName) == "";
if ($invalid_test || preg_match('/[^\\x20-\\x7f]/', $fileName)) {
$this->FilterInfo->Files->Warning[] = DUP_Encoding::toUTF8($filePath);
} else {
$this->Size += $fileSize;
$this->Files[] = $filePath;
}
if ($fileSize > DUPLICATOR_SCAN_WARNFILESIZE) {
$this->FilterInfo->Files->Size[] = $filePath . ' [' . DUP_Util::ByteSize($fileSize) . ']';
}
}
}
}
}
}
示例2: buildCleanup
private function buildCleanup()
{
$files = DUP_Util::ListFiles(DUPLICATOR_SSDIR_PATH_TMP);
$newPath = DUPLICATOR_SSDIR_PATH;
if (function_exists('rename')) {
foreach ($files as $file) {
$name = basename($file);
if (strstr($name, $this->NameHash)) {
rename($file, "{$newPath}/{$name}");
}
}
} else {
foreach ($files as $file) {
$name = basename($file);
if (strstr($name, $this->NameHash)) {
copy($file, "{$newPath}/{$name}");
unlink($file);
}
}
}
}
示例3: getFiles
private function getFiles()
{
foreach ($this->Dirs as $key => $val) {
$files = DUP_Util::ListFiles($val);
foreach ($files as $filePath) {
$fileName = basename($filePath);
$valid = true;
if (!is_dir($filePath)) {
if (!in_array(@pathinfo($filePath, PATHINFO_EXTENSION), $this->filterExtsArray) && is_readable($filePath)) {
$fileSize = @filesize($filePath);
$fileSize = empty($fileSize) ? 0 : $fileSize;
if (strlen($filePath) > 250 || preg_match('/(\\/|\\*|\\?|\\>|\\<|\\:|\\|\\|)/', $fileName) || trim($fileName) == "") {
array_push($this->WarnFileName, $filePath);
$valid = false;
}
if ($fileSize > DUPLICATOR_SCAN_WARNFILESIZE) {
array_push($this->WarnFileSize, $filePath . ' [' . DUP_Util::ByteSize($fileSize) . ']');
}
if ($valid) {
$this->Size += $fileSize;
$this->Files[] = $filePath;
} else {
$this->OmitFiles[] = $filePath;
}
} else {
$this->OmitFiles[] = $filePath;
}
}
}
}
}