Created
March 22, 2016 10:19
-
-
Save neetumorwani/c6f111c4f5535dfc30a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
checking