public static function extractZipArchive($file, $destinationDir, $createDir = false)
    {
        if (!file_exists($destinationDir)) {
            if (false === $createDir) {
                throw new ApplicationException(sprintf("Destination directory does not exist: %s .", $destinationDir));
            }

            $folderCreation = mkdir($destinationDir, 0777, true);
            if (false === $folderCreation) {
                throw new ApplicationException(sprintf("Destination directory cannot be created: %s .", $destinationDir));
            }

            if (!is_readable($destinationDir)) {
                throw new ApplicationException(sprintf("Destination directory is not readable: %s .", $destinationDir));
            }
        } elseif (!is_dir($destinationDir)) {
            throw new ApplicationException(sprintf("Destination directory cannot be created as a file with that name already exists: %s .", $destinationDir));
        }

        $archive = new ZipArchive();

        if (false === $archive->open($file)) {
            throw new ApplicationException(sprintf("Could not open archive: %s .", $archive));
        }
        try {
            $archive->extractTo($destinationDir);
        } catch (\Exception $e) {
            throw new ApplicationException(sprintf("Could not extract archive from path: %s .", $file));
        }

        $archive->close();
    }