Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

7.0.0 #78

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
composer.lock
phpunit.xml
vendor
.idea
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 7.0.0 (released 2017-xx-xx)

- ...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add changelog


## 6.1.2 (released 2016-12-28)

- Added wkhtmltopdf detection
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Contributions are welcome, and are accepted via pull requests. Please review the
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](http://git-scm.com/book/en/Git-Tools-Rewriting-History) them before submitting.
* You may also need to [rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) to avoid merge conflicts.


## Running Tests

You will need an install of [Composer](https://getcomposer.org) before continuing.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2017 Chris Schuld <[email protected]>
Copyright (c) 2013-present Chris Schuld <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
99 changes: 92 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,13 @@ The Browser class allows you to detect a user's browser and version.
* Lynx
* Safari
* Chrome
* Navigator
* GoogleBot
* Yahoo! Slurp
* W3C Validator
* Android Navigator
* UC Browser
* BlackBerry
* IceCat
* Nokia S60 OSS Browser
* Nokia Browser
* MSN Browser
* MSN Bot
* Netscape Navigator
* Galeon
* NetPositive
Expand All @@ -69,14 +66,16 @@ The Browser class allows you to detect a user's browser and version.
* Yandex Browser
* Comodo Dragon
* Samsung Browser
* wkhtmltopdf

### Usage

```php
use Sinergi\BrowserDetector\Browser;

$browser = new Browser();
$browser = new Browser();

//You can also provide a userAgent string if you don't wish to detect the current browser
//$browser = new Browser("Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0");

if ($browser->getName() === Browser::IE && $browser->getVersion() < 11) {
echo 'Please upgrade your browser.';
Expand All @@ -97,6 +96,92 @@ if ($browser->getName() === Browser::IE && $browser->isCompatibilityMode()) {
}
```

## Scripted Agent Detection

The ScriptedAgent class allows you to detect scripted agents (bots, spiders, tools)

### Scripted Agents Detected

Spiders

* GoogleBot
* Baidu
* Bing
* MSN
* Yahoo! Slurp
* W3C Spiders
* Yandex
* Apple
* Paper.li
* Majestic12
* Livelap
* Scoop.it
* Who.is
* Proximic

Web Surveys

* Ahrefs
* MetaURI
* Netcraft
* Browsershots
* MageReport
* SocialRank.io
* Gluten Free
* Ubermetrics
* Verisign IPS-Agent

Exploits

* ShellShock

Web Preview bots

* ICQ
* Google Web
* Facebook
* Bing
* Twitter
* Skype

Tools

* wkHTMLtoPDF
* W3C Validator
* WebDAV
* TLSProbe
* Wget
* Zgrab

Generic

* Google Favicon
* Curl
* Python
* GoLang
* Perl
* Java

Ad bots

* Google
* Microsoft
* AdBeat

### Usage

```php
use Sinergi\BrowserDetector\Browser;

$browser = new Browser();

$scriptedAgent = $browser->detectScriptedAgent();
if ($scriptedAgent!==false)
{
die("Detected ".$scriptedAgent->getName()." which is a ".$scriptedAgent->getType().". Info: ".$scriptedAgent->getInfoURL());
}
```

## OS Detection

The OS class allows you to detect a user's operating system and version.
Expand Down
Loading