Projekt

Obecné

Profil

Stáhnout (591 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 42e372b4 Filip Jani
<?php
2
3
/**
4
 * Slouží pro vymazání cache po deploy.
5
 */
6
7 33840877 Filip Jani
include 'app/bootstrap-local.php';
8 42e372b4 Filip Jani
9
function deleteDir($dirPath) {
10
    if (! is_dir($dirPath)) {
11
        throw new InvalidArgumentException("$dirPath must be a directory");
12
    }
13
    if (substr($dirPath, strlen($dirPath) - 1, 1) != '/') {
14
        $dirPath .= '/';
15
    }
16
    $files = glob($dirPath . '*', GLOB_MARK);
17
    foreach ($files as $file) {
18
        if (is_dir($file)) {
19
            deleteDir($file);
20
        } else {
21
            unlink($file);
22
        }
23
    }
24
    rmdir($dirPath);
25
}
26
27
deleteDir($logDir);
28
deleteDir($tempDir);