private static function folderToZip($folder, &$zipFile, $parentPath) {
		
		$handle = opendir($folder);
		
		while (false !== $f = readdir($handle)) {
			
			// list of unwanted files
			$excluded = array('.', '..', '.DS_Store', 'thumbs.db');
			
			if (!in_array($f, $excluded)) {
				
				$filePath = $folder . '/' . $f;
				
				// removes prefix from file path before add to zip
				if (0 === strpos($filePath, $parentPath)) {
					$localPath = substr($filePath, strlen($parentPath . '/'));
				} 
				
				if (is_file($filePath)) {
					
					$zipFile->addFile($filePath, $localPath);
					
				} elseif (is_dir($filePath)) {
					
					// adds sub-directory
					$zipFile->addEmptyDir($localPath);
					self::folderToZip($filePath, $zipFile, $parentPath);
				}
				
			}
			
		}
		
		closedir($handle);
		
	}