예제 #1
0
 /**
  * Returns `true` if the request method is the expected or `false` otherwise.
  *
  * @inherit-doc
  */
 public function matches(RequestInterface $request)
 {
     return strtolower($request->getMethod()) == $this->expectedMethod;
 }
예제 #2
0
 /**
  * Returns `true` if the request is originated in a flash object or `false` otherwise.
  *
  * @inherit-doc
  */
 public function matches(RequestInterface $request)
 {
     return (bool) preg_match('/shockwave ?flash/i', $request->getHeader('USER-AGENT', false));
 }
예제 #3
0
 /**
  * Returns `true` if the request is originated in a mobile device or `false` otherwise.
  *
  * @inherit-doc
  */
 public function matches(RequestInterface $request)
 {
     static $regex_match = '#(nokia|iphone|android|motorola|^mot\\-|softbank|foma|docomo|kddi|up\\.browser|up\\.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\\-|longcos|pantech|gionee|^sie\\-|portalmmm|jig\\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\\s*mobi|opera\\*mini|320x320|240x320|176x220)#i';
     return $request->getHeader('X-WAP-PROFILE', false) !== false or $request->getHeader('PROFILE', false) !== false or preg_match($regex_match, strtolower($request->getHeader('USER-AGENT')));
 }
예제 #4
0
 /**
  * Returns `true` if the request was made via a XmlHttpRequest object or `false` otherwise.
  *
  * @inherit-doc
  */
 public function matches(RequestInterface $request)
 {
     return strtolower($request->getHeader('X-REQUESTED-WITH', false)) === 'xmlhttprequest';
 }