public function cleanDirectory($directoryName, $deleteRootDirectory = false)
    {
        if(is_dir($directoryName)){
            $files = glob( $directoryName . '/*', GLOB_NOSORT );

            foreach( $files as $file )
            {
                $this->cleanDirectory( $file, true );
            }

            if(file_exists($directoryName) && ($deleteRootDirectory == true)) {
                @rmdir( $directoryName );
            }
        } elseif(is_file($directoryName)) {
            @unlink( $directoryName );
        }

        if(file_exists($directoryName)) {
            return true;
        }

        return false;
    }