path_regex = $path_regex; $this->dont_negate = $dont_negate; } function useOffset($offset) { $this->offset = $offset; } function isSatisfiedBy($request) { $path = $request->getHttpRequest()->getUriPath(); $path = $this->_applyOffset($path); if($this->dont_negate) return preg_match($this->path_regex, $path); else return !preg_match($this->path_regex, $path); } function _applyOffset($path) { if(!$this->offset) return $path; $pieces = explode($this->offset, $path, 2); return isset($pieces[1]) ? $pieces[1] : $pieces[0]; } } ?>