src/Core/Project.php
protected function flushDir($dir)
    {
        if (!file_exists($dir)) {
            echo "HELP cant find ".$dir."\n";
            return;
        }
        $objects = scandir($dir);
        foreach ($objects as $object) {
            try {
                $this->deleteFile($object, $dir);
            } catch (Exception $e) {
                echo "Can't remove Folder/File ".$dir.DIRECTORY_SEPARATOR.$object."<br />\n"
                        . $e->getMessage()."<br />\n";
            }
        }
    }
protected function flushDir($dir)
    {
        if (!file_exists($dir)) {
            echo "HELP cant find ".$dir."\n";
            return;
        }
        $objects = scandir($dir);
        foreach ($objects as $object) {
            try {
                $this->deleteFile($object, $dir);
            } catch (Exception $e) {
                echo "Can't remove Folder/File ".$dir.DIRECTORY_SEPARATOR.$object."<br />\n"
                        . $e->getMessage()."<br />\n";
            }
        }
    }
protected function flushDir ( $ dir ) { if ( ! file_exists ( $ dir ) ) { echo "HELP cant find " . $ dir . "\n" ; return ; } $ objects = scandir ( $ dir ) ; foreach ( $ objects as $ object ) { try { $ this -> deleteFile ( $ object , $ dir ) ; } catch ( Exception $ e ) { echo "Can't remove Folder/File " . $ dir . DIRECTORY_SEPARATOR . $ object . "<br />\n" . $ e -> getMessage ( ) . "<br />\n" ; } } }
Deletes contents of a folder and content

@param string $dir   Directory path
Deletes contents of a folder and content