Exemplo n.º 1
0
 /**
  * Attempt to find a conclusive match for the given $userAgent
  *
  * @param string $userAgent
  *
  * @return string Matching WURFL deviceID
  */
 public function applyConclusiveMatch($userAgent)
 {
     if (Utils::checkIfContains($userAgent, 'GoogleImageProxy')) {
         return 'google_image_proxy';
     }
     if (Utils::checkIfStartsWith($userAgent, 'Mozilla')) {
         $tolerance = Utils::firstCloseParen($userAgent);
     } else {
         $tolerance = Utils::firstSlash($userAgent);
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
Exemplo n.º 2
0
 public function applyConclusiveMatch($userAgent)
 {
     if (Utils::checkIfContains($userAgent, 'BB10')) {
         $tolerance = Utils::indexOfOrLength($userAgent, ')');
     } else {
         if (Utils::checkIfStartsWith($userAgent, 'Mozilla/4')) {
             $tolerance = Utils::secondSlash($userAgent);
         } else {
             if (Utils::checkIfStartsWith($userAgent, 'Mozilla/5')) {
                 $tolerance = Utils::ordinalIndexOf($userAgent, ';', 3);
             } elseif (Utils::checkIfStartsWith($userAgent, 'PlayBook')) {
                 $tolerance = Utils::firstCloseParen($userAgent);
             } else {
                 $tolerance = Utils::firstSlash($userAgent);
             }
         }
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
Exemplo n.º 3
0
 public function testCloseParen()
 {
     $this->assertEquals(9, Utils::firstCloseParen('Value(12)'));
     $this->assertNull(Utils::firstCloseParen('Value'));
 }