public function AcquiaPurgeService::addPaths in Acquia Purge 7
Queue several paths.
Add paths to the queue, meant for later processing. When late runtime processing is enabled, processing of the queue likely happens during this same request, but is not a guarantee. With cron-processing enabled, the added item can get processed from there. When adding items as logged-in Drupal user, the client-side AJAX processor will show up for this user when rendering any (authenticated) page. See the FAQ on instructions on how to process the queue yourself, although this is not recommended with the already available means of processing.
Parameters
string[] $paths: Array with Drupal paths (for example: '<front>', 'user/1' or a alias).
Return value
array Associative array with the keys 'running', 'total', 'remaining', 'good', 'bad', 'percent' and 'purgehistory'.
File
- lib/
AcquiaPurgeService.php, line 165 - Contains AcquiaPurgeService.
Class
- AcquiaPurgeService
- The Acquia Purge service.
Code
public function addPaths(array $paths) {
$items = array();
// Clean the paths, skip duplicates and build the item array.
foreach ($paths as $path) {
$path = _acquia_purge_input_clean($path);
if (!$this
->deduplicate($path)) {
$items[] = array(
$path,
);
}
}
// Queue the items and trigger the processors to start processing.
if ($this
->queue()
->createItemMultiple($items)) {
$this
->processors()
->emit('onItemsQueued');
}
return $this
->stats();
}