.helpers
5 years ago
examples
2 years ago
src
7 months ago
.mddoc.xml
2 years ago
LICENSE.md
5 years ago
Makefile
3 years ago
.mddoc.xml
92 lines
| 1 | <mddoc> |
| 2 | <docpage target="README.md"> |
| 3 | |
| 4 | <autoloader namespace="donatj\UserAgent" type="psr4" root="src" /> |
| 5 | |
| 6 | <section title="PHP User Agent Parser"> |
| 7 | <text><](https://gitter.im/PhpUserAgentParser/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 9 | ]]></text> |
| 10 | <badge-poser type="version"/> |
| 11 | <badge-poser type="downloads"/> |
| 12 | <badge-poser type="license"/> |
| 13 | <badge-github-action name="donatj/phpUserAgent" workflow-file="ci.yml"/> |
| 14 | <section title="What It Is"> |
| 15 | <text><![CDATA[ |
| 16 | A simple, streamlined PHP user-agent parser! |
| 17 | |
| 18 | Licensed under the MIT license: https://www.opensource.org/licenses/mit-license.php |
| 19 | ]]></text> |
| 20 | </section> |
| 21 | <section title="Upgrading to `1.*`"> |
| 22 | <text><![CDATA[ |
| 23 | The new `1.*` release **does not break compatibility** with `0.*` and nothing need to change to upgrade. However, the global `parse_user_agent` is now deprecated; it has been replaced with the namespaced `\donatj\UserAgent\parse_user_agent` and functions exactly the same. You can easily replace any existing call to `parse_user_agent` with `\donatj\UserAgent\parse_user_agent` |
| 24 | |
| 25 | In addition, 1.x adds a convenience object wrapper you may use should you prefer. More information on this is in the Usage section below. |
| 26 | ]]></text> |
| 27 | </section> |
| 28 | <section title="Why Use This"> |
| 29 | <text><![CDATA[ |
| 30 | You have your choice in user-agent parsers. This one detects **all modern browsers** in a very light, quick, understandable fashion. |
| 31 | It is less than 200 lines of code, and consists of just three regular expressions! |
| 32 | It can also correctly identify exotic versions of IE others fail on. |
| 33 | |
| 34 | It offers 100% unit test coverage, is installable via Composer, and is very easy to use. |
| 35 | ]]></text> |
| 36 | </section> |
| 37 | <section title="What It Does Not Do"> |
| 38 | <text><![CDATA[ |
| 39 | This is not meant as a browser "knowledge engine" but rather a simple parser. Anything not adequately provided directly by the user agent string itself will simply not be provided by this. |
| 40 | ]]></text> |
| 41 | |
| 42 | <section title="OS Versions"> |
| 43 | <text>< I created for a client if you want to poke it, I update it from time to time, but frankly if you need to *reliably detect OS Version*, using user-agent isn't the way to do it. I'd go with JavaScript. |
| 53 | ]]></text> |
| 54 | </section> |
| 55 | <section title="Undetectable Browsers"> |
| 56 | <text><![CDATA[ |
| 57 | - **Brave** - Brave is simply not differentiable from Chrome. This was a design decision on their part. |
| 58 | ]]></text> |
| 59 | </section> |
| 60 | <section title="Undetectable Platforms"> |
| 61 | <text><) |
| 63 | ]]></text> |
| 64 | </section> |
| 65 | </section> |
| 66 | <section title="Requirements"> |
| 67 | <composer-requires/> |
| 68 | </section> |
| 69 | <section title="Installing"> |
| 70 | <text>PHP User Agent is available through Packagist via Composer.</text> |
| 71 | <composer-install/> |
| 72 | </section> |
| 73 | <section title="Usage"> |
| 74 | <text>The classic procedural use is as simple as:</text> |
| 75 | <source name="examples/procedural.php" lang="php" /> |
| 76 | |
| 77 | <text>The new object-oriented wrapper form:</text> |
| 78 | <source name="examples/object-oriented.php" lang="php" /> |
| 79 | </section> |
| 80 | <section title="Currently Detected Platforms"> |
| 81 | <exec cmd="php .helpers/constants.php 'donatj\UserAgent\Platforms' 'Platform'"/> |
| 82 | </section> |
| 83 | <section title="Currently Detected Browsers"> |
| 84 | <exec cmd="php .helpers/constants.php 'donatj\UserAgent\Browsers' 'Browser'"/> |
| 85 | </section> |
| 86 | <text><. |
| 88 | ]]></text> |
| 89 | </section> |
| 90 | </docpage> |
| 91 | </mddoc> |
| 92 |