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

Source for file NonMobile.php

Documentation is available at NonMobile.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4: */
  3.  
  4. /**
  5.  * PHP versions 4 and 5
  6.  *
  7.  * Copyright (c) 2003-2009 KUBO Atsuhiro <kubo@iteman.jp>,
  8.  * All rights reserved.
  9.  *
  10.  * Redistribution and use in source and binary forms, with or without
  11.  * modification, are permitted provided that the following conditions are met:
  12.  *
  13.  *     * Redistributions of source code must retain the above copyright
  14.  *       notice, this list of conditions and the following disclaimer.
  15.  *     * Redistributions in binary form must reproduce the above copyright
  16.  *       notice, this list of conditions and the following disclaimer in the
  17.  *       documentation and/or other materials provided with the distribution.
  18.  *
  19.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  20.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  21.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  22.  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  23.  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24.  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25.  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26.  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27.  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29.  * POSSIBILITY OF SUCH DAMAGE.
  30.  *
  31.  * @category   Networking
  32.  * @package    Net_UserAgent_Mobile
  33.  * @author     KUBO Atsuhiro <kubo@iteman.jp>
  34.  * @copyright  2003-2009 KUBO Atsuhiro <kubo@iteman.jp>
  35.  * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License
  36.  * @version    CVS: $Id: NonMobile.php,v 1.1 2009/05/26 08:48:16 kuboa Exp $
  37.  * @since      File available since Release 0.1.0
  38.  */
  39.  
  40. require_once 'Net/UserAgent/Mobile/Common.php';
  41. require_once 'Net/UserAgent/Mobile/Display.php';
  42.  
  43. // {{{ Net_UserAgent_Mobile_NonMobile
  44.  
  45. /**
  46.  * Non-Mobile Agent implementation
  47.  *
  48.  * Net_UserAgent_Mobile_NonMobile is a subclass of
  49.  * {@link Net_UserAgent_Mobile_Common}, which implements non-mobile or unimplemented
  50.  * user agents.
  51.  *
  52.  * SYNOPSIS:
  53.  * <code>
  54.  * require_once 'Net/UserAgent/Mobile.php';
  55.  *
  56.  * $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/4.0';
  57.  * $agent = &Net_UserAgent_Mobile::factory();
  58.  * </code>
  59.  *
  60.  * @category   Networking
  61.  * @package    Net_UserAgent_Mobile
  62.  * @author     KUBO Atsuhiro <kubo@iteman.jp>
  63.  * @copyright  2003-2009 KUBO Atsuhiro <kubo@iteman.jp>
  64.  * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License
  65.  * @version    Release: 1.0.0
  66.  * @since      Class available since Release 0.1.0
  67.  */
  68. {
  69.  
  70.     // {{{ properties
  71.  
  72.     /**#@+
  73.      * @access public
  74.      */
  75.  
  76.     /**#@-*/
  77.  
  78.     /**#@+
  79.      * @access private
  80.      */
  81.  
  82.     /**#@-*/
  83.  
  84.     /**#@+
  85.      * @access public
  86.      */
  87.  
  88.     // }}}
  89.     // {{{ isNonMobile()
  90.  
  91.     /**
  92.      * returns true
  93.      *
  94.      * @return boolean 
  95.      */
  96.     function isNonMobile()
  97.     {
  98.         return true;
  99.     }
  100.  
  101.     // }}}
  102.     // {{{ parse()
  103.  
  104.     /**
  105.      * Parses HTTP_USER_AGENT string.
  106.      *
  107.      * @param string $userAgent User-Agent string
  108.      */
  109.     function parse($userAgent)
  110.     {
  111.         @list($this->name$this->versionexplode('/'$userAgent);
  112.     }
  113.  
  114.     // }}}
  115.     // {{{ makeDisplay()
  116.  
  117.     /**
  118.      * create a new {@link Net_UserAgent_Mobile_Display} class instance
  119.      *
  120.      * @return Net_UserAgent_Mobile_Display 
  121.      */
  122.     function makeDisplay()
  123.     {
  124.         return new Net_UserAgent_Mobile_Display(null);
  125.     }
  126.  
  127.     // }}}
  128.     // {{{ getCarrierShortName()
  129.  
  130.     /**
  131.      * returns the short name of the carrier
  132.      *
  133.      * @return string 
  134.      */
  135.     function getCarrierShortName()
  136.     {
  137.         return 'N';
  138.     }
  139.  
  140.     // }}}
  141.     // {{{ getCarrierLongName()
  142.  
  143.     /**
  144.      * returns the long name of the carrier
  145.      *
  146.      * @return string 
  147.      */
  148.     function getCarrierLongName()
  149.     {
  150.         return 'NonMobile';
  151.     }
  152.  
  153.     /**#@-*/
  154.  
  155.     /**#@+
  156.      * @access private
  157.      */
  158.  
  159.     /**#@-*/
  160.  
  161.     // }}}
  162. }
  163.  
  164. // }}}
  165.  
  166. /*
  167.  * Local Variables:
  168.  * mode: php
  169.  * coding: iso-8859-1
  170.  * tab-width: 4
  171.  * c-basic-offset: 4
  172.  * c-hanging-comment-ender-p: nil
  173.  * indent-tabs-mode: nil
  174.  * End:
  175.  */

Documentation generated on Tue, 23 Jun 2009 10:00:05 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.