try to use next backup driver.

@return bool
773928
public function tryNextDriver()
    {
        $backupDriverName = array_pop($this->backupDrivers);
        if ($backupDriverName) {
           return $this->runDriver($backupDriverName);
        }

        return false;
    }
1222708
public function run($driverName = null)
    {
        if ($this->isRunning()) {
            return false;
        }
        if (!$this->beforeRun()) {
            return false;
        }
        if (!$driverName) {
            $driverName = $this->getDriverNameByWeight();
        }
        $this->initBackupDrivers([$driverName]);
        $success = $this->runDriver($driverName);

        return $this->afterRun($success);
    }
410671
private static function driver()
    {
        $options = config('cache.options');

        $driver = config('cache.default');

        switch ($driver) {
            case 'file':
                    return instance(FileDriver::class);
                break;

            case 'apc':
                    return instance(ApcDriver::class);
                break;

            case 'database':
                    return instance(PDODriver::class);
                break;

            default:
                    exception(DriverNotFoundException::class);
                break;
        }
    }
1046163
public function execute()
    {
        $successful = true;
        try {
            // Dump all databases
            $this->databaseManager->dump();

            // Backup folders if specified
            $this->logger->info('[dizda-backup] Copying folders.');
            $this->processorManager->copyFolders();

            // Compress everything
            $this->logger->info(sprintf('[dizda-backup] Compressing to archive using %s', $this->processorManager->getName()));
            $this->processorManager->compress();

            // Transfer with all clients
            $this->clientManager->upload($this->processorManager->getArchivePath());
        } catch (\Exception $e) {
            // Write log
            $this->logger->critical('[dizda-backup] Unexpected exception.', array('exception' => $e));

            $successful = false;
        }

        try {
            // If we catch an exception or not, we would still like to try cleaning up after us
            $this->logger->info('[dizda-backup] Cleaning up after us.');
            $this->processorManager->cleanUp();
        } catch (IOException $e) {
            $this->logger->error('[dizda-backup] Cleaning up failed.', array('exception' => $e));

            return false;
        }

        if ($successful) {
            $this->eventDispatcher->dispatch(BackupEvent::BACKUP_COMPLETED, new BackupEvent());
        }

        return $successful;
    }
656950
public function update()
    {
        if ($this->newVersionAvailable === false
        || (!is_bool($this->newVersionAvailable) && !$this->hasUpdate())) {
            return false;
        }
        $this->backupPhar();
        $this->downloadPhar();
        $this->replacePhar();
        return true;
    }
831650
public function rewind()
    {
        $this->restoreServices();

        $db         = $this->getDbAdapter();
        $platform   = $db->getPlatform();
        $driver     = $db->getDriver();

        if ( $this->isMultisite() )
        {
            $query = $db->query( '
                SELECT *
                  FROM ' . $platform->quoteIdentifier( '_central' ) .
                     '.' . $platform->quoteIdentifier( 'fulldomain' ) . '
                 WHERE ' . $platform->quoteIdentifier( 'subdomain' ) . '
                     = ' . $driver->formatParameterName( 'subdomain' ) . '
            ' );
        }
        else
        {
            $query = $db->query( '
                SELECT *
                  FROM ' . $platform->quoteIdentifier( 'subdomain' ) . '
                 WHERE ' . $platform->quoteIdentifier( 'subdomain' ) . '
                     = ' . $driver->formatParameterName( 'subdomain' ) . '
            ' );
        }

        $this->queriedSchemas   = array();
        $this->queryResult      = $query->execute( array(
            'subdomain' => '',
        ) );

        $this->queryResult->rewind();
        return $this->createCurrentSiteInfo();
    }
1107942
public function connect() {
        if ($this->isConnected()) {
            return true;
        }

        if (!$this->isEnabled()) {
            throw new MissingDriverException('mongodb driver extension is not enabled');
        }

        $options = [];

        if ($db = $this->getDatabase()) {
            $options['db'] = $db;
        }

        if ($user = $this->getUser()) {
            $options['username'] = $user;
        }

        if ($pass = $this->getPassword()) {
            $options['password'] = $pass;
        }

        if ($rSet = $this->getConfig('replicaSet')) {
            if (!$this->getConfig('servers')) {
                throw new MissingServersException('A list of servers is required for replica set functionality');
            }

            $options['replicaSet'] = $rSet;
        }

        $connection = new MongoClient($this->getServer(), $options + $this->getConfig('flags'));

        $this->_connections[$this->getContext()] = $connection;

        return $connection->connected;
    }
198558
public function process() {
        global $DB;
        $filepathdir = make_backup_temp_directory($this->filepath, false);
        if (!file_exists($filepathdir) || !is_dir($filepathdir)) {
            throw new restore_ui_exception('invalidrestorepath');
        }
        if (optional_param('searchcourses', false, PARAM_BOOL)) {
            return false;
        }
        $this->target = optional_param('target', backup::TARGET_NEW_COURSE, PARAM_INT);
        $targetid = optional_param('targetid', null, PARAM_INT);
        if (!is_null($this->target) && !is_null($targetid) && confirm_sesskey()) {
            if ($this->target == backup::TARGET_NEW_COURSE) {
                list($fullname, $shortname) = restore_dbops::calculate_course_names(0, get_string('restoringcourse', 'backup'), get_string('restoringcourseshortname', 'backup'));
                $this->courseid = restore_dbops::create_new_course($fullname, $shortname, $targetid);
            } else {
                $this->courseid = $targetid;
            }
            return ($DB->record_exists('course', array('id' => $this->courseid)));
        }
        return false;
    }
1040827
public function trySRVRecord()
    {
        $srvhost = '_autodiscover._tcp.' . $this->tld;
        $lookup = dns_get_record($srvhost, DNS_SRV);
        if (sizeof($lookup) > 0) {
            $host = $lookup[0]['target'];
            $url = 'https://' . $host . self::AUTODISCOVER_PATH;
            if ($this->tryViaUrl($url)) {
                return self::AUTODISCOVERED_VIA_SRV_RECORD;
            }
        }

        return false;
    }
1242972
public function rollback() {
		$this->txStatus = self::TX_NOT_STARTED;
		$this->txCounter = 0;
		return $this->driver->rollback();
	}
459518
public function connect() {
        if ($this->isConnected()) {
            return true;
        }

        // @codeCoverageIgnoreStart
        if (!$this->isEnabled()) {
            throw new MissingDriverException(sprintf('%s driver extension is not enabled', $this->getDriver()));
        }
        // @codeCoverageIgnoreEnd

        $this->_connections[$this->getContext()] = new PDO($this->getDsn(), $this->getUser(), $this->getPassword(), $this->getConfig('flags') + [
            PDO::ATTR_PERSISTENT => $this->isPersistent(),
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
        ]);

        return true;
    }
608960
public function next() {
		if ($this->currentRecord < count($this->files)) {
			$file = $this->files[$this->currentRecord];
			$this->currentRecord++;
			return $file;
		} else {
			return false;
		}
	}
833072
protected function downloadListBackup()
    {
        $backup_id = $this->getQuery('download');

        if (empty($backup_id)) {
            return null;
        }

        $this->controlAccess('backup_download');

        $backup = $this->backup->get($backup_id);

        if (!empty($backup['path'])) {
            $this->download(gplcart_file_absolute($backup['path']));
        }
    }
1218774
protected function execute_condition() {

        // Check it is included in the backup
        $fullpath = $this->task->get_taskbasepath();
        $fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
        if (!file_exists($fullpath)) {
            // Not found, can't restore course logs
            return false;
        }

        return true;
    }
692238
public function MoveNext()
	{
		if ( ! $this->iterationStarted )
		{
			$this->current = $this->original->CloneInstane();
			$this->iterationStarted = true;
		}
		if ( ! is_null( $this-current ) && $this->current->MoveNext() )
		{
			return true;
		}
		$this->current = null;
		return false;
	}
1051928
public function persist()
    {

        $blob = $this->serializer->serialize($this->_attributes, $this->serializeOptions);

        $result = (bool)$this->filesystem->write($this->url, $blob, $this->getOption('file_locking'));

        if (!$hashMethod = $this->getOption('checksum_method')) {
            return $result;
        }

        $checksum = $this->createChecksum($hashMethod, $blob);

        $savedBlob = $this->filesystem->read($this->url);

        $this->checkData($hashMethod, $savedBlob, $checksum);

        return $result;
    }
94044
public static function _rollBack ()
	{
		
		if (self::$_lastID)
		{
			
			if (!static::_delete (self::$_lastID))
			{
				return FALSE;
			}
			
			self::$_lastID	= FALSE;
			
		}
		
		return TRUE;
		
	}