/**
  * Update the stored database.
  *
  * @since 0.1.0
  *
  * @param Event $event
  */
 public static function update(Event $event)
 {
     $dbFilename = Database::getLocation();
     self::maybeCreateDBFolder(dirname($dbFilename));
     $oldMD5 = self::getMD5($dbFilename . '.md5');
     self::downloadFile($dbFilename . '.md5', Database::MD5_URL);
     $newMD5 = self::getMD5($dbFilename . '.md5');
     if ($newMD5 === $oldMD5) {
         return;
     }
     $io = $event->getIO();
     $io->write('Fetching new version of the MaxMind GeoLite2 Country database...', true);
     self::downloadFile($dbFilename . '.gz', Database::DB_URL);
     $io->write('Unzipping the database...', true);
     self::unzipFile($dbFilename);
     $io->write('Removing zipped file...', true);
     self::removeFile($dbFilename . '.gz');
     $io->write(sprintf('The MaxMind GeoLite2 Country database has been updated (%1$s).', $dbFilename), true);
 }