You are here

protected function ConfigSplitIgnoreFilter::stringMatch in Configuration Split Ignore 8

Checks if a string matches a given wildcard pattern.

Parameters

$pattern: The wildcard pattern to me matched.

$string: The string to be checked.

Return value

bool TRUE if $string string matches the $pattern pattern.

3 calls to ConfigSplitIgnoreFilter::stringMatch()
ConfigSplitIgnoreFilter::activeRead in src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php
Read from the active configuration.
ConfigSplitIgnoreFilter::getIgnoredKeys in src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php
Returns the list of ignored configuration names with their ignored keys.
ConfigSplitIgnoreFilter::matchConfigName in src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php
Match a config entity name against the list of ignored config entities.

File

src/Plugin/ConfigFilter/ConfigSplitIgnoreFilter.php, line 71

Class

ConfigSplitIgnoreFilter
Provides a ignore filter that allows to delete the configuration entities.

Namespace

Drupal\config_split_ignore\Plugin\ConfigFilter

Code

protected function stringMatch($pattern, $string) {
  $pattern = '/^' . preg_quote($pattern, '/') . '$/';
  $pattern = str_replace('\\*', '.*', $pattern);
  return (bool) preg_match($pattern, $string);
}