Guest User

Untitled

a guest
Dec 12th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. class Whatever
  4. {
  5. public function invalidate()
  6. {
  7. if (\count($this->objects_to_invalidate) < 1)
  8. {
  9. return [];
  10. }
  11.  
  12. try
  13. {
  14. $endpoint = '/zones/pull.json/417146/cache';
  15.  
  16. $this->maxcdn_client->delete($endpoint, ['files' => $this->objects_to_invalidate]);
  17.  
  18. return $this->objects_to_invalidate;
  19. }
  20. catch (RWSException $exception)
  21. {
  22. $error_message = '[MaxCDN] ' . $exception->getMessage();
  23.  
  24. throw new CdnException($error_message, $exception->getCode());
  25. }
  26. }
  27. }
Add Comment
Please, Sign In to add comment