source: branches/version-2_5-dev/data/module/Net/UserAgent/Mobile/NonMobile.php @ 20116

Revision 20116, 4.2 KB checked in by nanasess, 13 years ago (diff)
  • svn properties を再設定
  • 再設定用のスクリプト追加
  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
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$
37 * @since      File available since Release 0.1.0
38 */
39
40require_once dirname(__FILE__) . '/Common.php';
41require_once dirname(__FILE__) . '/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 */
68class Net_UserAgent_Mobile_NonMobile extends Net_UserAgent_Mobile_Common
69{
70
71    // {{{ properties
72
73    /**#@+
74     * @access public
75     */
76
77    /**#@-*/
78
79    /**#@+
80     * @access private
81     */
82
83    /**#@-*/
84
85    /**#@+
86     * @access public
87     */
88
89    // }}}
90    // {{{ isNonMobile()
91
92    /**
93     * returns true
94     *
95     * @return boolean
96     */
97    function isNonMobile()
98    {
99        return true;
100    }
101
102    // }}}
103    // {{{ parse()
104
105    /**
106     * Parses HTTP_USER_AGENT string.
107     *
108     * @param string $userAgent User-Agent string
109     */
110    function parse($userAgent)
111    {
112        @list($this->name, $this->version) = explode('/', $userAgent);
113    }
114
115    // }}}
116    // {{{ makeDisplay()
117
118    /**
119     * create a new {@link Net_UserAgent_Mobile_Display} class instance
120     *
121     * @return Net_UserAgent_Mobile_Display
122     */
123    function makeDisplay()
124    {
125        return new Net_UserAgent_Mobile_Display(null);
126    }
127
128    // }}}
129    // {{{ getCarrierShortName()
130
131    /**
132     * returns the short name of the carrier
133     *
134     * @return string
135     */
136    function getCarrierShortName()
137    {
138        return 'N';
139    }
140
141    // }}}
142    // {{{ getCarrierLongName()
143
144    /**
145     * returns the long name of the carrier
146     *
147     * @return string
148     */
149    function getCarrierLongName()
150    {
151        return 'NonMobile';
152    }
153
154    /**#@-*/
155
156    /**#@+
157     * @access private
158     */
159
160    /**#@-*/
161
162    // }}}
163}
164
165// }}}
166
167/*
168 * Local Variables:
169 * mode: php
170 * coding: iso-8859-1
171 * tab-width: 4
172 * c-basic-offset: 4
173 * c-hanging-comment-ender-p: nil
174 * indent-tabs-mode: nil
175 * End:
176 */
Note: See TracBrowser for help on using the repository browser.