本文整理汇总了PHP中LocalRepo::quickCleanDir方法的典型用法代码示例。如果您正苦于以下问题:PHP LocalRepo::quickCleanDir方法的具体用法?PHP LocalRepo::quickCleanDir怎么用?PHP LocalRepo::quickCleanDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalRepo
的用法示例。
在下文中一共展示了LocalRepo::quickCleanDir方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purgeThumbList
/**
* Delete a list of thumbnails visible at urls
* @param string $dir base dir of the files.
* @param array $files of strings: relative filenames (to $dir)
*/
protected function purgeThumbList($dir, $files)
{
$fileListDebug = strtr(var_export($files, true), array("\n" => ''));
wfDebug(__METHOD__ . ": {$fileListDebug}\n");
$purgeList = array();
foreach ($files as $file) {
# Check that the base file name is part of the thumb name
# This is a basic sanity check to avoid erasing unrelated directories
if (strpos($file, $this->getName()) !== false || strpos($file, "-thumbnail") !== false) {
$purgeList[] = "{$dir}/{$file}";
}
}
# Delete the thumbnails
$this->repo->quickPurgeBatch($purgeList);
# Clear out the thumbnail directory if empty
$this->repo->quickCleanDir($dir);
}