You are here

public function ExpirePanels::placeholdersToWildcard in Panels Cache Expiration 7

Replace placeholders with wildcard.

1 call to ExpirePanels::placeholdersToWildcard()
ExpirePanels::expire in includes/expire.panels.inc
Executes expiration actions for panels.

File

includes/expire.panels.inc, line 123
Provides class that expires panels.

Class

ExpirePanels
@file Provides class that expires panels.

Code

public function placeholdersToWildcard($url) {
  $processed_url = array();
  $parts = explode('/', $url);

  // @todo need to handle wildcards within URL.
  foreach ($parts as $part) {

    // Look for placeholder that starts with "%" or "!".
    if (preg_match('/^%|^!(|' . DRUPAL_PHP_FUNCTION_PATTERN . ')$/', $part)) {
      return implode('/', $processed_url) . '|wildcard';
    }
    $processed_url[] = $part;
  }
  return $url;
}