You are here

private function FileExcludeFilter::matchPath in Backup and Migrate 5.0.x

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 src/Core/Filter/FileExcludeFilter.php
The 'beforeDbTableBackup' plugin op.

File

src/Core/Filter/FileExcludeFilter.php, line 93

Class

FileExcludeFilter
@package Drupal\backup_migrate\Core\Filter

Namespace

Drupal\backup_migrate\Core\Filter

Code

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