My code below to delete cache :
Warning : as it is now when I call the function , I also delete .htaccess file set the pass while calling function to delete what you want , place this file in chat root.
You must set correct permissions on folder 777.
function deleteDir($dir)
{
if (substr($dir, strlen($dir)-1, 1) != '/')
$dir .= '/';
echo $dir.'
';
if ($handle = opendir($dir))
{
while ($obj = readdir($handle))
{
if ($obj != '.' && $obj != '..')
{
if (is_dir($dir.$obj))
{
if (!deleteDir($dir.$obj))
return false;
}
elseif (is_file($dir.$obj))
{
if (!unlink($dir.$obj))
return false;
}
}
}
closedir($handle);
if (!@rmdir($dir))
return false;
return true;
}
return false;
}
if (@opendir('data/public')) {
deleteDir('data/public');
deleteDir('data/private');
echo 'Above cache list has been cleared! - You can close the window';
}else{echo 'Chat cache is already empty!';}