Download the PHP package hocvt/browser-detect without Composer

On this page you can find all versions of the php package hocvt/browser-detect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package browser-detect

Browser Detection Logo

Browser Detection v5.0 by hisorange

Latest Stable Version Build Coverage Status Total Downloads License

Easy to use package to identify the visitor's browser details and device type. Magic is not involved the results are generated by multiple well tested and developed packages.

Supports every Laravel version between 4.0 » 10.x; Also tested on every PHP version between 5.6 » 8.2.

How to install


Yep, it's ready to be used by You! ^.^

How to use


In Your code just call the Browser facade:

Even in Your blade templates:

Easy peasy, ain't it?

Version support


The following matrix has been continuously tested by the great and awesome GitHub Actions!

----- Browser Detect 1.x Browser Detect 2.x Browser Detect 3.x Browser Detect 4.x Browser Detect 5.x
Laravel 4.x - - -
Laravel 5.x - - -
Laravel 6.x - - - -
Laravel 7.x - - - -
Laravel 8.x - - - 4.4+ -
Laravel 9.x - - - 4.4+
Laravel 10.x - - - -
Standalone - - - 4.2+

Since 2013 the package runs tests on every possible PHP / Laravel version matrix.

Standalone mode, without Laravel!


Based on community requests; Now You can use the library without Laravel. Just simply use the Parser class as a static object.

Available API calls


Every call on the Browser facade is proxied to a result object, so the following information are available on Your result too, where You can use the [array] syntax to access them.

Call Response Internal Type
Browser::userAgent() Current visitor's HTTP_USER_AGENT string. (string)
Browser::isMobile() Is this a mobile device. (boolean)
Browser::isTablet() Is this a tablet device. (boolean)
Browser::isDesktop() Is this a desktop computer. (boolean)
Browser::isBot() Is this a crawler / bot. (boolean)
Browser::deviceType() Enumerated response for [Mobile, Tablet, Desktop, and Bot] (string)
Browser related functions
Browser::browserName() Browser's human friendly name like Firefox 3.6, Chrome 42. (string)
Browser::browserFamily() Browser's vendor like Chrome, Firefox, Opera. (string)
Browser::browserVersion() Browser's human friendly version string. (string)
Browser::browserVersionMajor() Browser's semantic major version. (integer)
Browser::browserVersionMinor() Browser's semantic minor version. (integer)
Browser::browserVersionPatch() Browser's semantic patch version. (integer)
Browser::browserEngine() Browser's engine like: Blink, WebKit, Gecko. (string)
Operating system related functions
Browser::platformName() Operating system's human friendly name like Windows XP, Mac 10. (string)
Browser::platformFamily() Operating system's vendor like Linux, Windows, Mac. (string)
Browser::platformVersion() Operating system's human friendly version like XP, Vista, 10. (integer)
Browser::platformVersionMajor() Operating system's semantic major version. (integer)
Browser::platformVersionMinor() Operating system's semantic minor version. (integer)
Browser::platformVersionPatch() Operating system's semantic patch version. (integer)
Operating system extended functions
Browser::isWindows() Is this a windows operating system. (boolean)
Browser::isLinux() Is this a linux based operating system. (boolean)
Browser::isMac() Is this an iOS or Mac based operating system. (boolean)
Browser::isAndroid() Is this an Android operating system. (boolean)
Device related functions
Browser::deviceFamily() Device's vendor like Samsung, Apple, Huawei. (string)
Browser::deviceModel() Device's brand name like iPad, iPhone, Nexus. (string)
Browser vendor related functions
Browser::isChrome() Is this a chrome browser. (boolean)
Browser::isFirefox() Is this a firefox browser. (boolean)
Browser::isOpera() Is this an opera browser. (boolean)
Browser::isSafari() Is this a safari browser. (boolean)
Browser::isIE() Checks if the browser is an some kind of Internet Explorer (or Trident) (boolean)
Browser::isIEVersion() Compares to a given IE version (boolean)
Browser::isEdge() Is this a microsoft edge browser. (boolean)
Miscellaneous
Browser::isInApp() Check for browsers rendered inside applications like android webview. (boolean)

Configuration, personalization


If You are using Laravel then after installation run the following command:

For standalone mode to apply Your custom configuration:

Since the package aims to be easy to use, there is not much to configure. But You can customize the cache and security values.

Advanced Usage Information


The code is designed to be an easy to use style, so every call You make on the Browser facade will access the result object and get the data for You, but You can parse agents other than the current user's.

Worthy notion! The parser only parsing each user agent string once and then caches it, it uses an in-memory runtime cache for multiple calls in a single page load; And it will use the application's cache to persist the result for a week or so, this should provide You with a sufficient caching mechanism so the detection will cost less than 0.02 millisecond, this was tested with an 80,000 fake visit.

Changelog


See the detailed changes in the CHANGELOG file.


All versions of browser-detect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ua-parser/uap-php Version ~3.9
league/pipeline Version ^1.0
mobiledetect/mobiledetectlib Version ~3.74
jaybizzle/crawler-detect Version ~1.2
matomo/device-detector Version ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hocvt/browser-detect contains the following files

Loading the files please wait ....