exs / php-user-agent-bundle
Wrapper for global function in https://github.com/donatj/PhpUserAgent/
Installs: 1 169
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 10
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=7.2
- donatj/phpuseragentparser: dev-master
- symfony/framework-bundle: ~3.4
- symfony/symfony: 3.4.*
This package is auto-updated.
Last update: 2025-01-28 03:31:30 UTC
README
Wrapper for global function in https://github.com/donatj/PhpUserAgent/
Installing the # EXS-PhpUserAgentBundle in a new Symfony2 project
Edit composer.json file with # EXS-PhpUserAgentBundle dependency:
//composer.json //... "require": { //other bundles "exs/php-user-agent-bundle": "^1.0" },
Save the file and have composer update the project via the command line:
composer update exs/php-user-agent-bundle"
Update the app/AppKernel.php
//app/AppKernel.php //... public function registerBundles() { $bundles = array( //Other bundles new EXS\PhpUserAgentBundle\EXSPhpUserAgentBundle(), );
Usage
// initiate the service $service = new EXS\PhpUserAgentBundle\Services\PhpUserAgentService(); $service->parseUserAgent(USER_AGENT_STRING_HERE); // Get the detected platform type $service->getFlatform(); // Get the detected browser type $service->getBrowser(); // Get the detected browser version $service->getVersion();
Contributing
Anyone and everyone is welcome to contribute.
If you have any questions or suggestions please let us know.