4 * Detect whether request should be debugged
7 * @author Stephen Clay <steve@mrclay.org>
9 class Minify_DebugDetector {
10 public static function shouldDebugRequest($cookie, $get, $requestUri)
12 if (isset($get['debug'])) {
15 if (! empty($cookie['minifyDebug'])) {
16 foreach (preg_split('/\\s+/', $cookie['minifyDebug']) as $debugUri) {
17 $pattern = '@' . preg_quote($debugUri, '@') . '@i';
18 $pattern = str_replace(array('\\*', '\\?'), array('.*', '.'), $pattern);
19 if (preg_match($pattern, $requestUri)) {