Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (30 sloc) 0.828 kB
<?php
$server = 'pear.Chiara';
//$server = 'test.pear.php.net';
$temp_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'pear-core-test';
function cleanall($dir = null)
{
if ($dir !== null) {
$statedir = $dir;
} else {
$statedir = $GLOBALS['statedir'];
}
clearstatcache();
if (file_exists($statedir)) {
$dp = opendir($statedir);
while ($ent = readdir($dp)) {
if (in_array($ent, array('.', '..'))) {
continue;
}
if (is_dir($statedir . DIRECTORY_SEPARATOR . $ent)) {
cleanall($statedir . DIRECTORY_SEPARATOR . $ent);
continue;
}
unlink($statedir . DIRECTORY_SEPARATOR . $ent);
}
closedir($dp);
rmdir($statedir);
}
}
cleanall($temp_path);
?>
Jump to Line
Something went wrong with that request. Please try again.