protected static function SplitFilter::inFilterList in Configuration Split 8
Check whether the needle is in the haystack.
Parameters
string $name: The needle which is checked.
string[] $list: The haystack, a list of identifiers to determine whether $name is in it.
Return value
bool True if the name is considered to be in the list.
2 calls to SplitFilter::inFilterList()
- SplitFilter::calculateBlacklist in src/
Plugin/ ConfigFilter/ SplitFilter.php - Calculate the blacklist by including dependents and resolving wild cards.
- SplitFilter::calculateGraylist in src/
Plugin/ ConfigFilter/ SplitFilter.php - Calculate the graylist by including dependents and resolving wild cards.
File
- src/
Plugin/ ConfigFilter/ SplitFilter.php, line 417
Class
- SplitFilter
- Provides a SplitFilter.
Namespace
Drupal\config_split\Plugin\ConfigFilterCode
protected static function inFilterList($name, array $list) {
// Prepare the list for regex matching by quoting all regex symbols and
// replacing back the original '*' with '.*' to allow it to catch all.
$list = array_map(function ($line) {
return str_replace('\\*', '.*', preg_quote($line, '/'));
}, $list);
foreach ($list as $line) {
if (preg_match('/^' . $line . '$/', $name)) {
return TRUE;
}
}
return FALSE;
}