library/FileCopier.php
public function createEmptyDirectory($directory)
    {
        if (!is_dir($directory)) {
            mkdir($directory, 0777, true);
        } else {
            $this->deleteTree($directory, false);
        }
    }
public function createEmptyDirectory($directory)
    {
        if (!is_dir($directory)) {
            mkdir($directory, 0777, true);
        } else {
            $this->deleteTree($directory, false);
        }
    }
public function createEmptyDirectory ( $ directory ) { if ( ! is_dir ( $ directory ) ) { mkdir ( $ directory , 0777 , true ) ; } else { $ this -> deleteTree ( $ directory , false ) ; } }
Creates new directory if it does not exists, if exists - clears its content.

@param string $directory
Creates new directory if it does not exists if exists - clears its content .