You are here

private function FileExcludeFilter::matchPath in Backup and Migrate 8.4

Match a path to the list of exclude patterns.

Parameters

string $path: The path to match.

array $exclude: An array of regular expressions to match against.

string $base_path:

Return value

bool

1 call to FileExcludeFilter::matchPath()
FileExcludeFilter::beforeFileBackup in lib/backup_migrate_core/src/Filter/FileExcludeFilter.php
The 'beforeDBTableBackup' plugin op.

File

lib/backup_migrate_core/src/Filter/FileExcludeFilter.php, line 85

Class

FileExcludeFilter
Class FileExcludeFilter.

Namespace

BackupMigrate\Core\Filter

Code

private function matchPath($path, $exclude, $base_path = '') {
  $path = substr($path, strlen($base_path));
  if ($exclude) {
    foreach ($exclude as $pattern) {
      if (preg_match($pattern, $path)) {
        return TRUE;
      }
    }
  }
  return FALSE;
}