{"id":28417459,"url":"https://github.com/ua-parser/uap-php","last_synced_at":"2025-06-26T06:32:12.474Z","repository":{"id":23031906,"uuid":"26384659","full_name":"ua-parser/uap-php","owner":"ua-parser","description":"PHP implementation of ua-parser","archived":false,"fork":false,"pushed_at":"2024-06-03T09:06:30.000Z","size":775,"stargazers_count":538,"open_issues_count":13,"forks_count":85,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-06-21T05:40:41.220Z","etag":null,"topics":["browser","php","user-agents"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ua-parser.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-09T04:09:14.000Z","updated_at":"2025-06-16T06:42:39.000Z","dependencies_parsed_at":"2022-07-13T22:50:29.043Z","dependency_job_id":"eeeacd2b-f6f2-4d56-aa82-b83be3819ee1","html_url":"https://github.com/ua-parser/uap-php","commit_stats":{"total_commits":322,"total_committers":25,"mean_commits":12.88,"dds":0.5590062111801242,"last_synced_commit":"b796c5ea5df588e65aeb4e2c6cce3811dec4fed6"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/ua-parser/uap-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-parser%2Fuap-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-parser%2Fuap-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-parser%2Fuap-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-parser%2Fuap-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ua-parser","download_url":"https://codeload.github.com/ua-parser/uap-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ua-parser%2Fuap-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261208953,"owners_count":23125346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","php","user-agents"],"created_at":"2025-06-04T05:43:18.820Z","updated_at":"2025-06-26T06:32:12.465Z","avatar_url":"https://github.com/ua-parser.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ua-parser PHP Library #\n\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ua-parser/uap-php?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge) [![Build Status](https://travis-ci.org/ua-parser/uap-php.svg?branch=master)](https://travis-ci.org/ua-parser/uap-php) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/ua-parser/uap-php.svg)](http://isitmaintained.com/project/ua-parser/uap-php \"Average time to resolve an issue\") [![Percentage of issues still open](http://isitmaintained.com/badge/open/ua-parser/uap-php.svg)](http://isitmaintained.com/project/ua-parser/uap-php \"Percentage of issues still open\")\n[![Latest Stable Version](https://poser.pugx.org/ua-parser/uap-php/v/stable)](https://packagist.org/packages/ua-parser/uap-php)\n[![Total Downloads](https://poser.pugx.org/ua-parser/uap-php/downloads)](https://packagist.org/packages/ua-parser/uap-php)\n[![License](https://poser.pugx.org/ua-parser/uap-php/license)](https://packagist.org/packages/ua-parser/uap-php)\n\nThis is the PHP library for the [uap-core](https://github.com/ua-parser/uap-core) project.\n\n## Installation ##\nAdd `ua-parser/uap-php` to the require section of your `composer.json` file and run `composer update`.\n\n## Usage ##\n\nStraightforward:\n\n```php\nrequire_once 'vendor/autoload.php';\nuse UAParser\\Parser;\n\n$ua = \"Mozilla/5.0 (Macintosh; Intel Ma...\";\n\n$parser = Parser::create();\n$result = $parser-\u003eparse($ua);\n\nprint $result-\u003eua-\u003efamily;            // Safari\nprint $result-\u003eua-\u003emajor;             // 6\nprint $result-\u003eua-\u003eminor;             // 0\nprint $result-\u003eua-\u003epatch;             // 2\nprint $result-\u003eua-\u003etoString();        // Safari 6.0.2\nprint $result-\u003eua-\u003etoVersion();       // 6.0.2\n\nprint $result-\u003eos-\u003efamily;            // Mac OS X\nprint $result-\u003eos-\u003emajor;             // 10\nprint $result-\u003eos-\u003eminor;             // 7\nprint $result-\u003eos-\u003epatch;             // 5\nprint $result-\u003eos-\u003epatchMinor;        // [null]\nprint $result-\u003eos-\u003etoString();        // Mac OS X 10.7.5\nprint $result-\u003eos-\u003etoVersion();       // 10.7.5\n\nprint $result-\u003edevice-\u003efamily;        // Other\n\nprint $result-\u003etoString();            // Safari 6.0.2/Mac OS X 10.7.5\nprint $result-\u003eoriginalUserAgent;     // Mozilla/5.0 (Macintosh; Intel Ma...\n```\n\n## Using Your Own Custom regexes.php File ##\n\nYou can use your own `regexes.php` file if you've customized the official file. I *strongly* encourage you to push back any changes you may have so others can benefit. That said, to use your own do the following:\n\n```php\nrequire_once 'vendor/autoload.php';\nuse UAParser\\Parser;\n\n$parser = Parser::create(\"path/to/custom/regexes.php\");\n```\n\n## Using ua-parser PHP Library from the Command Line ##\n\nA command line utility is now included with the PHP library. The following commands are supported:\n\n### Get Usage Info\n\nProvides simple usage information:\n\n    php bin/uaparser\n\n### Update the regexes.php File\n\nFetches an updated YAML file for `ua-parser` and overwrites the current regexes.php file. You can use the following as part of a cron job that runs nightly.\n\n    php bin/uaparser ua-parser:update [--no-backup]\n\nBy default creates a backup file. Use `--no-backup` to turn that feature off.\n\n### Convert an Existing regexes.yaml File to regexes.php\n\nWith the change to v2.0 you may have an existing and customized YAML file for `ua-parser`. Use the following to convert it to JSON.\n\n    php bin/uaparser ua-parser:convert [file]\n\n### Grab Just the Latest regexes.yaml File From the Repository\n\nIf you need to add a new UA it's easier to edit the original YAML and then convert it to JSON.\n\n    php bin/uaparser ua-parser:fetch [file]\n\nFetches an updated YAML file. *Warning:* This method overwrites any existing `regexes.yaml` file.\n\n### Parse a Single User Agent String\n\nParses a user agent string and dumps the results as a list.\n\n    php bin/uaparser ua-parser:parse \"your user agent string\"\n\n### Parse a Webserver Log File\n\nParses the supplied log file or log directory to test ua-parser. Saves the UA to a file when the UA or OS family aren't recognized or when the UA is listed as a generic smartphone or as a generic feature phone.\n\n    php bin/uaparser ua-parser:logfile [-f /path/to/logfile] [-d /path/to/logdir] [--include \"*.gz\"] [--exclude \"*.gz\"] errors.log\n\nMultiple `--include` and `--exclude` parameters are allowed.\n\n## Credits ##\n\nThanks to the [original ua-parser team](http://code.google.com/p/ua-parser/people/list) for making the YAML file available for others to build upon.\n\nAlso, many thanks to the following major contributors to the PHP library:\n\n* Bryan Shelton\n* Michael Bond\n* @rjd22\n* Timo Tijhof\n* Marcus Bointon\n* Ryan Parman\n* Pravin Dahal\n\n## Licensing ##\n* The library is licensed under the MIT license\n* The user agents data from the ua-parser project is licensed under the Apache license\n* The initial list of generic feature phones \u0026 smartphones came from Mobile Web OSP under the MIT license\n* The initial list of spiders was taken from Yiibu's profile project under the MIT license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fua-parser%2Fuap-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fua-parser%2Fuap-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fua-parser%2Fuap-php/lists"}