function _clearTempFold($dir)
{
if (!is_dir($dir))
{
return;
}
$_dirHandle = opendir($dir);
while ($_handle = readdir($_dirHandle))
{
// 排除
if ($_handle == '.' || $_handle == '..')
{
continue;
}
$_path = $dir . DIRECTORY_SEPARATOR . $_handle;
if (is_dir($_path))
{
$this->_clearTempFold($_path);
}
if (is_file($_path))
{
unlink($_path);
}
}
closedir($_dirHandle);
rmdir($dir);
}
```
版权归属:
Malson
许可协议:
MIT