TeraWurfl
[ class tree: TeraWurfl ] [ index: TeraWurfl ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <title>Remote Tera-WURFL Remote Client Example</title>
  6. </head>
  7. <body>
  8. <?php
  9. $start microtime(true);
  10. require_once realpath(dirname(__FILE__).'/../../TeraWurflRemoteClient.php');
  11. $wurflObj new TeraWurflRemoteClient('http://localhost/Tera-Wurfl/webservice.php');
  12. $capabilities array("product_info","fake_capability");
  13. // NOTE: You must use $FORMAT_XML to communicate with Tera-WURFL 2.1.1 and earlier!
  14. $data_format TeraWurflRemoteClient::$FORMAT_JSON;
  15. $wurflObj->getCapabilitiesFromAgent(null,$capabilities,$data_format);
  16. $time round(microtime(true)-$start,6);
  17. echo "<h3>Response from Tera-WURFL ".$wurflObj->getAPIVersion()."</h3>";
  18. echo "<pre>".var_export($wurflObj->capabilities,true)."</pre>";
  19. if($wurflObj->errors){
  20.     foreach($wurflObj->errors as $name => $error){
  21.         echo "$name$error<br/>";
  22.     }
  23. }
  24. echo "<hr/>Total Time: $time";
  25. ?>
  26. </body>
  27. </html>

Documentation generated on Sun, 19 Sep 2010 00:15:49 +0000 by phpDocumentor 1.4.3