exs/php-user-agent-bundle
Composer 安装命令:
composer require exs/php-user-agent-bundle
包简介
Wrapper for global function in https://github.com/donatj/PhpUserAgent/
README 文档
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.
统计信息
- 总下载量: 1.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-16