You are here

private function BakeryRequestPolicy::pregArrayKeyExists in Bakery Single Sign-On System 8.2

Check pattern key exist in array.

Parameters

string $pattern: Regex pattern to match key.

array $array: Array from which key needs to be checked.

Return value

int if found return positive number else -1

1 call to BakeryRequestPolicy::pregArrayKeyExists()
BakeryRequestPolicy::check in src/PageCache/BakeryRequestPolicy.php
Determines whether delivery of a cached page should be attempted.

File

src/PageCache/BakeryRequestPolicy.php, line 37

Class

BakeryRequestPolicy
A policy allowing delivery of cached pages when there is no session open.

Namespace

Drupal\bakery\PageCache

Code

private function pregArrayKeyExists($pattern, $array) {
  $keys = array_keys($array);
  return (int) preg_grep($pattern, $keys);
}