Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Purge varnish cache for a url.
- *
- * @param array $url_pieces
- * An array of pieces to look for, or regexes.
- */
- function ugc_varnish_purge_pieces(array $url_pieces) {
- $regex = implode('(/.*|$)', $url_pieces);
- ugc_varnish_purge($regex);
- }
- function ugc_varnish_purge($regex) {
- _ugc_varnish_terminal_run("purge req.url ~ $regex");
- }
Add Comment
Please, Sign In to add comment