public function get_log_file()
 {
     if (!$this->logFile) {
         WP_Backup::create_dump_dir();
         $path = WP_Backup_Registry::config()->get_backup_dir() . DIRECTORY_SEPARATOR . self::LOGFILE;
         $files = glob($path . '.*');
         if (isset($files[0])) {
             $this->logFile = $files[0];
         } else {
             $this->logFile = $path . '.' . WP_Backup_Registry::get_secret($file);
         }
     }
     return $this->logFile;
 }
 public function get_file($secret = true)
 {
     if (!$this->type) {
         throw new Exception();
     }
     $file = rtrim($this->config->get_backup_dir(), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . DB_NAME . "-backup-{$this->type}.sql";
     $files = glob($file . '*');
     if ($files) {
         foreach ($files as $file) {
             if (preg_match('/(.?)' . preg_quote("-backup-{$this->type}.sql") . '(.?)/', $file)) {
                 return $file;
             }
         }
     }
     if ($secret) {
         $file .= '.' . WP_Backup_Registry::get_secret(DB_NAME);
     }
     return $file;
 }