Skip to content

Commit 5b9a984

Browse files
author
dutchenkoOleg
committed
Merge branch 'release/1.0.0'
2 parents 6237fe9 + e895e3c commit 5b9a984

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# Browserizr PHP
22

3-
![Status - Working in progress](https://img.shields.io/badge/Status-WIP-red.svg)
43
[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dutchenkoOleg/node-w3c-validator/blob/master/LICENSE)
4+
[![WezomAgency](https://img.shields.io/badge/wezom-agency-red.svg)](https://github.com/WezomAgency)
5+
6+
> **Browserizr** is tiny library, that detects your browser and platform,
7+
> with testing `$_SERVER['HTTP_USER_AGENT']`.
8+
9+
_that is PHP port of JavaScript library [WezomAgency/Browserizr](https://github.com/WezomAgency/browserizr)
10+
with several limitations..._

src/WezomAgency/Browserizr.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ public static function add_classes($tests, $css_prefix = '')
8686

8787
/**
8888
* Checkout/re-checkout all detections
89+
* @param string $custom_user_agent
8990
*/
90-
public static function detect()
91+
public static function detect($custom_user_agent = null)
9192
{
92-
self::$agent = $_SERVER['HTTP_USER_AGENT'] ?: '';
93+
self::$agent = $custom_user_agent ?: $_SERVER['HTTP_USER_AGENT'] ?: '';
9394

9495
self::$is_android = !!preg_match('/android/i', self::$agent);
9596
self::$is_android3 = !!preg_match('/android 3/i', self::$agent);

0 commit comments

Comments
 (0)