本文整理汇总了PHP中Dir::rmdirRecursive方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::rmdirRecursive方法的具体用法?PHP Dir::rmdirRecursive怎么用?PHP Dir::rmdirRecursive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::rmdirRecursive方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractor_run
} else {
$body = extractor_run($f);
if (!$body) {
$body = '';
}
$description = '';
$keywords = '';
$title = basename($f);
}
$data = array('title' => $title, 'url' => $url, 'description' => $description, 'keywords' => $keywords, 'body' => $body, 'access' => 'public', 'status' => 'approved', 'team' => 'none', 'ctype' => $ctype, 'mtime' => (string) $mtime, 'domain' => $domain);
// add file to index
$counts[$ctype]++;
$res = $search->addDocument($data);
if (!$res) {
echo 'Error adding document: ' . $search->error . NEWLINE;
echo 'Document URL: ' . $data['url'] . NEWLINE;
return;
}
}
if ($info['type'] == 'site') {
Dir::rmdirRecursive('tmp');
$search->deleteExpired((string) $mtime - 1, $info['domain']);
}
}
}
$search->deleteExpired((string) $mtime - 1, $default_domain);
@chmod_recursive($search->path, 0777);
$etime = time();
// log our activities for big brother
$logger = new SiteSearchLogger();
$logger->logIndex($mtime, $etime, $counts);
示例2: rmdirRecursive
function rmdirRecursive($path = '')
{
$d = dir($path);
while ($file = $d->read()) {
if ($file != '.' && $file != '..') {
if (@is_writeable($path . '/' . $file)) {
if (@is_dir($path . '/' . $file) && !@is_link($path . '/' . $file)) {
Dir::rmdirRecursive($path . '/' . $file);
} else {
unlink($path . '/' . $file);
}
} else {
return 0;
}
}
}
$d->close();
return rmdir($path);
}