Skip to content

Instantly share code, notes, and snippets.

@neetumorwani
Created March 22, 2016 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neetumorwani/c6f111c4f5535dfc30a7 to your computer and use it in GitHub Desktop.
Save neetumorwani/c6f111c4f5535dfc30a7 to your computer and use it in GitHub Desktop.
$purgeQueue = \Drupal::service('purge.queue');
$items = $purgeQueue->claim();
$newitems = array();
$uris = array();
foreach($items as $item) {
if($item->getPluginId()==='url') {
$newitems[] = $item;
}
}
foreach($newitems as $item) {
$urlObj = $item->getUrl();
$fullurls = $urlObj->getUri();
$component = parse_url($fullurls);
$uris[] = $component['path'];
}
$client = \Drupal::service('akamai.edgegridclient');
$client->purgeUrls($uris);
@neetumorwani
Copy link
Author

checking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment