Wrapper method for Riak::repair().

@see http://php.net/manual/en/mongodb.repair.php
@param boolean $preserveClonedFiles
@param boolean $backupOriginalFiles
@return array
183946
public function repair($preserveClonedFiles = false, $backupOriginalFiles = false)
    {
        return $this->riak->repair($preserveClonedFiles, $backupOriginalFiles);
    }
12241
public function createBackup($originalPath)
    {
        // Bail if file does not exist
        if (!file_exists($originalPath)) {
            return false;
        }

        $pathinfo = pathinfo($originalPath);

        $backupPrefered = $pathinfo['dirname'] . '/' . $pathinfo['filename'] . '.' . $pathinfo['extension'] . '.bkp';
        $backupFile = $backupPrefered;

        $i = 0;
        while (file_exists($backupFile)) {
            $i++;
            $backupFile = $backupPrefered . $i;
        }

        if (copy($originalPath, $backupFile)) {
            return $backupFile;
        }

        return false;
    }
462818
protected void doRestore(File backupFile) throws BackupException
   {
      if (!PrivilegedFileHelper.exists(backupFile))
      {
         LOG.warn("Nothing to restore for quotas");
         return;
      }

      ZipObjectReader in = null;
      try
      {
         in = new ZipObjectReader(PrivilegedFileHelper.zipInputStream(backupFile));
         quotaPersister.restoreWorkspaceData(rName, wsName, in);
      }
      catch (IOException e)
      {
         throw new BackupException(e);
      }
      finally
      {
         if (in != null)
         {
            try
            {
               in.close();
            }
            catch (IOException e)
            {
               LOG.error("Can't close input stream", e);
            }
         }
      }

      repairDataSize();
   }
1299164
public function restore()
    {
        if (!userHasPermission('admin:blog:post:' . $this->blog->id . ':restore')) {

            unauthorised();
        }

        // --------------------------------------------------------------------------

        //  Fetch and check post
        $iPostId = (int) $this->uri->segment(6);

        // --------------------------------------------------------------------------

        if ($this->blog_post_model->restore($iPostId)) {

            $oPost = $this->blog_post_model->getById($iPostId);

            $this->session->set_flashdata('success', ucfirst($this->data['postName']) . ' was restored successfully.');

            //  Update admin changelog
            $this->oChangeLogModel->add(
                'restored',
                'a',
                'blog post',
                $iPostId,
                $oPost->title,
                'admin/blog/post/create/' . $this->blog->id . '/' . $iPostId
            );

        } else {

            $sStatus   = 'error';
            $sMessage  = 'I failed to restore that ' . $this->data['postName'] . '. ';
            $sMessage .= $this->blog_post_model->lastError();
            $this->session->set_flashdata($sStatus, $sMessage);
        }

        redirect('admin/blog/post/index/' . $this->blog->id);
    }
896644
public function restore($file, $revision)
    {
        $call = 'restore/' . $this->root . '/' . $this->encodePath($file);
        $params = array('rev' => $revision);
        $response = $this->fetch('POST', self::API_URL, $call, $params);
        return $response;
    }
212129
private void restoreBackupIncremental() {

        try {
            if (fa.isStreamElement(fileName + ".backup")) {
                RAShadowFile.restoreFile(fileName + ".backup",
                                         fileName + ".data");
            } else {
/*
                // this is to ensure file has been written fully but it is not necessary
                // as semantics dictate that if a backup does not exist, the file
                // was never changed or was fully written to
                if (FileUtil.exists(cacheFileName)) {
                    int flags = DataFileCache.getFlags(cacheFileName);

                    if (!BitMap.isSet(flags, DataFileCache.FLAG_ISSAVED)) {
                        FileUtil.delete(cacheFileName);
                    }
                }
*/
            }

            deleteBackup();
        } catch (IOException e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR, fileName + ".backup");
        }
    }
901812
function archiveOriginal(callback) {
      const archivedOriginal = path.join(outdirectory, '/archived.kml');
      const infileContents = fs.readFileSync(infile);

      fs.writeFile(archivedOriginal, infileContents, (err) => {
        if (err) return callback(err);
        return callback();
      });
    }
1336728
function restore() {
    if (isOriginal) return;
    else isOriginal = true;
    ['log', 'debug', 'info', 'warn', 'error'].forEach((item) => {
        console[item] = originalConsoleFunctions[item];
    });
}
224027
public function getEmptyClone($keepFilters = true)
    {
        $clone = new DataTable;
        if ($keepFilters) {
            $clone->queuedFilters = $this->queuedFilters;
        }
        $clone->metadata = $this->metadata;
        return $clone;
    }
252103
public function reset()
    {
        /** @var $result CallResult */
        $result = $this->getSvn()->{'revert'}($this->getRepositoryPath(), array(
            '--recursive',
            '--',
            '.'
        ));
        $result->assertSuccess(sprintf('Cannot reset "%s"', $this->getRepositoryPath()));

        $status = $this->getStatus();
        foreach ($status as $item) {
            $file   = $this->resolveFullPath($item['file']);
            if (@unlink($file) !== true || $item['status'] !== 'unversioned') {
                throw new \RuntimeException('Cannot delete file "'.$item['file'].'"');
            }
        }
    }
1333823
public function commit($expungeDeletes = false, $waitFlush = null, $waitSearcher = true, $timeout = 3600)
    {
        if ($waitFlush) {
            user_error('waitFlush must be false when using Solr 4.0+' . E_USER_ERROR);
        }

        $expungeValue = $expungeDeletes ? 'true' : 'false';
        $searcherValue = $waitSearcher ? 'true' : 'false';

        $rawPost = '<commit expungeDeletes="' . $expungeValue . '" waitSearcher="' . $searcherValue . '" />';
        return $this->_sendRawPost($this->_updateUrl, $rawPost, $timeout);
    }
581977
public function restore() 
    {
        $state = array_pop($this->savedStates);
        if ($state != NULL) {
            $this->transform = $state['transform'];
            $this->fillStyle = $state['fillStyle'];
        }
    }
178777
public function restoreDB($dumpName = 'test')
    {
        $this->setDumpName($dumpName);
        $tables = $this->getDbTables();

        $dumpChecksum = $this->getDumpChecksum();
        $dumpTables = array_keys($dumpChecksum);

        foreach ($tables as $table) {
            if (!in_array($table, $dumpTables)) {
                $this->dropTable($table);
            } else {
                $this->restoreTable($table);
            }
        }

        $missingTables = array_diff($dumpTables, $tables);
        foreach ($missingTables as $table) {
            $this->restoreTable($table);
        }
        $this->setDumpName('test');
    }
194066
private function getBackups()
    {
        $backups = $this->getContainer()->getParameter('nanbando.backup');

        $preset = [];
        if ($name = $this->getParameter('nanbando.application.name')) {
            /** @var PresetStore $presetStore */
            $presetStore = $this->getContainer()->get('presets');
            $preset = $presetStore->getPreset(
                $name,
                $this->getParameter('nanbando.application.version'),
                $this->getParameter('nanbando.application.options')
            );
        }

        return array_merge($preset, $backups);
    }
484470
public function variants($withOriginal = false)
    {
        $variants = array_keys($this->config->variantConfigs());

        if ($withOriginal && ! in_array(FileHandler::ORIGINAL, $variants)) {
            array_unshift($variants, FileHandler::ORIGINAL);
        }

        return $variants;
    }
248131
protected function createBackupFile($original, $backup)
    {
        $isOk = !file_exists($original) || rename($original, $backup);

        return $isOk;
    }
745882
protected function checkCache($originalFile, $cacheFile)
    {
        if (! $ret = parent::checkCache($originalFile, $cacheFile)) {
            return false;
        }

        if (Utils::isSerialized($ret, $ret)) {
            // Go through each file and make sure none of them have changed
            foreach ($ret['files'] as $file => $lastModified) {
                if (filemtime($file) > $lastModified) {
                    return false;
                }
            }

            $ret = serialize($ret);
        }

        return $ret;
    }