Some more tests and such.

This commit is contained in:
2014-10-01 08:10:39 -05:00
parent 97dba637d9
commit d20106a021
4 changed files with 126 additions and 11 deletions

View File

@@ -1,13 +1,22 @@
<?php
if (is_dir(__DIR__.'/tasty-sandwich'))
if (is_dir(__DIR__.'/queues/'))
{
foreach(glob(__DIR__.'/tasty-sandwich/*') as $file)
foreach(glob(__DIR__.'/queues/*', GLOB_ONLYDIR) as $queueDir)
{
if (substr($file, -1) === '.')
continue;
foreach(glob($queueDir.'/*') as $file)
{
$split = preg_split('#[/\\\]+#', $file);
if (strpos(end($split), '.') === 0)
continue;
unlink($file);
unlink($file);
}
rmdir($queueDir);
}
rmdir(__DIR__.'/tasty-sandwich');
}
else
{
mkdir(__DIR__.'/queues');
}