public function zipFile($source, $destination, $includeFolder = false) {
        if (!extension_loaded('zip') || !file_exists($source)) {
            return false;
        }

        $zip = new ZipArchive();
        if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
            return false;
        }

        $source = str_replace('\\', '/', realpath($source));
        $folder = $includeFolder ? basename($source) . '/' : '';

        if (is_dir($source) === true) {
            // add file to prevent empty archive error on download
            $zip->addFromString('fm.txt', "This archive has been generated by Rich Filemanager : https://github.com/servocoder/RichFilemanager/");

            $files = new RecursiveIteratorIterator(
                    new RecursiveDirectoryIterator($source, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST
            );

            foreach ($files as $file) {
                $file = str_replace('\\', '/', realpath($file));

                if (is_dir($file) === true) {
                    $path = str_replace($source . '/', '', $file . '/');
                    $zip->addEmptyDir($folder . $path);
                } else if (is_file($file) === true) {
                    $path = str_replace($source . '/', '', $file);
                    $zip->addFile($file, $folder . $path);
                }
            }
        } else if (is_file($source) === true) {
            $zip->addFile($source, $folder . basename($source));
        }

        return $zip->close();
    }