<?php
require_once 'src/autoloader.php';
define('CLEAN_DUMP', 1);define('DIR_TEST', __DIR__);define('DIR_TEST_IMG', __DIR__.'/images');define('DIR_TMP', __DIR__ . '/tmp');define('DIR_ASSERT_GD', __DIR__ . '/assert-gd');define('DIR_ASSERT_IMAGICK', __DIR__ . '/assert-imagick');
function deleteTmpDirectory()
{
$dir = __DIR__ . '/tmp';
foreach (scandir($dir) as $file) {
if ('.' === $file || '..' === $file) {
continue;
}
if (is_dir("$dir/$file")) {
rmdirRecursive("$dir/$file");
} else {
unlink("$dir/$file");
}
}
}
function rmdirRecursive($dir)
{
foreach (scandir($dir) as $file) {
if ('.' === $file || '..' === $file) {
continue;
}
if (is_dir("$dir/$file")) {
rmdirRecursive("$dir/$file");
} else {
unlink("$dir/$file");
}
}
return rmdir($dir);
}