add optional limit for updateA, add addAttachment() documentation
[php-utility-classes.git] / include / classes / useragent.php-class
CommitLineData
31733e08 1<?php
a5813ca3 2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is KaiRo's userAgent detection.
16 *
17 * The Initial Developer of the Original Code is
18 * KaiRo - Robert Kaiser.
19 * Portions created by the Initial Developer are Copyright (C) 2003
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s): Robert Kaiser <kairo@kairo.at>
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
31733e08 38class userAgent {
39 // userAgent PHP class
40 // get user agent and tell us what Browser is accessing
41 //
1defa974 42 // function userAgent([$ua_string])
43 // CONSTRUCTOR; reads UA string (or takes the optional given UA string) and gets info from that into our variables.
31733e08 44 //
45 // var $uastring
46 // the plain User Agent string
47 // var $brand
48 // returns the User Agent brand name
49 // var $version
50 // the User Agent version
a8464009 51 // var $bot
52 // bool: true if this agent is a bot
f983aa36 53 // var $uadata
54 // array of static user agent data (static vars in functions are set for all objects of this class!)
31733e08 55 //
23585ba2 56 // function getBrand()
57 // returns the User Agent Brand Name
58 // function getVersion()
59 // returns the User Agent version
60 //
f983aa36 61 // function getUAString()
62 // returns the full User Agent string
63 //
a8464009 64 // function isbot()
65 // returns true if User Agent seems to be a bot
31733e08 66 // function isns()
67 // returns true if User Agent seems to be Netscape brand, false if not
68 // function isns4()
69 // returns true if User Agent seems to be Netscape Communicator 4.x, false if not
70 // function isie()
71 // returns true if User Agent seems to be a version of Internet Exploder, false if not
72 // function geckobased()
73 // returns true if User Agent seems to be a Gecko-based browser, false if not
74 // function geckodate()
75 // returns the Gecko date when it's a Gecko-based browser, 0 if not
1defa974 76 // function khtmlbased()
77 // returns true if User Agent seems to be a KHTML-based browser, false if not
78
79 // collection of some known User Agent Strings:
80 // Mozilla/5.0 (compatible; Konqueror/3; Linux 2.4.18; X11; i686)
81 // Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.3b) Gecko/20030114
82 // Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
83 // Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Win 9x 4.90)
84 // Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
85 // Mozilla/4.75 [de] (Win98; U)
86 // Opera/5.12 (Windows 2000; U) [de]
87 // Mozilla/5.0 (Windows; U; Win 9x 4.90; de-DE; m18) Gecko/20010131 Netscape6/6.01
88 // Mozilla/5.0 (Windows; U; Windows NT 5.1; de-DE; rv:1.0.1) Gecko/20020823 Netscape/7.0
89 // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/51 (like Gecko) Safari/51
90 // Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6g
91 // Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.0.1) Gecko/20021109 Chimera/0.6+
a5813ca3 92 // Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7b) Gecko/20040302 Camino/0.7+
1defa974 93 // Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5
94 // Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20021204
95 // Mozilla/4.0 (compatible; MSIE 5.0; Windows XP) Opera 6.05 [ja]
96 // Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC) OmniWeb/4.1.1-v424.6
23585ba2 97 // Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6
98 // Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1
a5813ca3 99 // Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7a) Gecko/20040216 Firefox/0.8.0+
a8464009 100 // Python-urllib/1.15
101 // *** search bots: ***
f983aa36 102 // W3C_Validator/1.305.2.12 libwww-perl/5.64
a8464009 103 // Scooter/3.3
104 // Spinne/2.0 med_AH
105 // Vagabondo/2.0 MT (webagent at wise-guys dot nl)
106 // TurnitinBot/1.5 ( ">http://www.turnitin.com/robot/crawlerinfo.html)
107 // FAST-WebCrawler/3.x Multimedia (mm dash crawler at fast dot no)
108 // Firefly/1.0 (compatible; Mozilla 4.0; MSIE 5.5)
109 // Googlebot/2.1 (+ ">http://www.googlebot.com/bot.html)
110 // Scrubby/2.2 ( ">http://www.scrubtheweb.com/)
111 // psbot/0.1 (+ ">http://www.picsearch.com/bot.html)
112 // NG/1.0
113 // URL_Spider_Pro/3.0 ( ">http://www.innerprise.net/usp-spider.asp)"
114 // Pompos/1.3 ">http://dir.com/pompos.html
115 // Szukacz/1.5 (robot; www.szukacz.pl/jakdzialarobot.html; info@szukacz.pl)
116 // ASPseek/1.2.10
117 // NPBot-1/2.0
118 // NetResearchServer/2.7(loopimprovements.com/robot.html)
119 // dloader(NaverRobot)/1.0
120 // Mozilla/4.0 compatible ZyBorg/1.0 Daily Refresh Beta-d03 (wn.zyborg@looksmart.net;
121 // Mozilla/2.0 (compatible; Ask Jeeves/Teoma)
122 // Mozilla/5.0 (Slurp/si; slurp@inktomi.com; ">http://www.inktomi.com/slurp.html)
123 // Mozilla/5.0 [en] (compatible; Gulper Web Bot 0.2.4 www.ecsl.cs.sunysb.edu/~maxim/cgi-bin/Link/GulperBot)
124 // Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; Girafabot; girafabot at girafa dot com;
125 // Mozilla/4.0 (efp@gmx.net)
126 // Mozilla/4.5 (compatible; HTTrack 3.0x; Windows 98)
127 // PingALink Monitoring Services 1.0 (http://www.pingalink.com)
128 // IlTrovatore-Setaccio (+ ">http://www.iltrovatore.it)
129 // Mercator-2.0
130 // appie 1.1 (www.walhello.com)
131 // larbin_2.6.2 (larbin2.6.2@unspecified.mail)
132 // OWR_Crawler 0.1
133 // search.ch V1.4.2 (spiderman@search.ch;
134 // WebFilter Robot 1.0
135 // Openfind data gatherer, Openbot/3.0+(robot-response@openfind.com.tw;+
136 // LinkWalker
137 // Internet Explorer 5.5
138 // BaiDuSpider
139 // Mozilla/4.0 (compatible; B-l-i-t-z-B-O-T)
140 // B l i t z B O T @ t r i c u s . n e t (Mozilla compatible)
141 // sitecheck.internetseer.com (For more info see: ">http://sitecheck.internetseer.com)
142