Example #1
0
 public function getUrl()
 {
     do {
         $url = $this->configBlock->getUrl();
         $configOS = $this->configBlock->getOS();
         if ($configOS && $configOS != $this->user->getOS()) {
             continue;
         }
         $configLocale = $this->configBlock->getLocale();
         if ($configLocale != $this->user->getLocale()) {
             continue;
         }
         $configPlatform = $this->configBlock->getPlatform();
         if ($configPlatform && $configPlatform != $this->user->getPlatform()) {
             continue;
         }
         break;
     } while ($this->configBlock = $this->configBlock->child());
     return $url;
 }
Example #2
0
$configBlock = new ConfigBlock($config);
$agent = new Agent();
$user = new User($agent);
$redirect = new Redirect($configBlock, $user);
?>

locale: <?php 
echo $user->getLocale();
?>
<br>
platform: <?php 
echo $user->getPlatform();
?>
<br>
os: <?php 
echo $user->getOS();
?>
<br>

locales: <pre><?php 
echo print_r($agent->languages());
?>
</pre>

url to redirect: <?php 
echo $redirect->getUrl();
?>
<br>

<pre>
    <?php 
Example #3
0
 public function testOS()
 {
     $this->assertEquals('android', $this->user->getOS());
 }