You are here

public function PurgeHandlerHttprl::execute in Purge 7.2

File

includes/purge.class.inc, line 636
Contains all class and interface definitions for Purge.

Class

PurgeHandlerHttprl
Class definition for HTTPrl handler.

Code

public function execute($purges, $handler_options) {
  foreach ($purges as $purge_id => $purge) {
    $headers_array = headers2array($purge['headers']);

    // Gather options
    $options = array(
      'method' => $handler_options['method'],
      'blocking' => FALSE,
      'headers' => $purge['headers'],
    );

    // Queue the request
    httprl_request($purge['purge_url'], $options);

    // Since we don't care about the results, let's fake 200
    $purges[$purge_id]['http_code'] = 200;
  }

  // Issue all  requests.
  $request = httprl_send_request();
  return $purges;
}