Comments (4)
This seems to be a real problem which i not covered until yet.
After checking the two UA you provided, following providers are affected by this two examples
- DonatjUAParser
- SingergiBrowserDetector
- PiwikDeviceDetector
- WhichBrowser
- YzalisUAParser
Major/minor/patch are numbers, which i want to keep clean with numbers only. The question is if their are real
version numbers which are not numeric?
E.g. alpha, beta, RC, ...?? Or dates are sometimes also used as versioning? We need here some examples.
Reason is simple: Mixing is always bad, so comparisons like $os->getVersion()->getMajor() >= 7
wont work correctly anymore.
But OS nicknames are nice, so we should support them.
We may could/should also show it in the complete string. Or we split it to multiple methods.
$version->getNumberComplete(); // only numeric version with . (i dont like the method name yet)
$version->getComplete() // nickname with numeric version?
class Version{
// number
private $major;
// number
private $minor;
// number
private $patch;
// numeric with . seperator
private $completeNumeric
// string e.g. XP
private $alias;
// string e.g. XP 5.1 | or only numeric?
private $complete;
// maybe a stability flag?
private $stability;
}
Other things to keep in mind, if we do it in this kind of way
- support stability flag (beta, rc, alpha,...)
- ..?
from useragentparser.
Beta example:
Mozilla/5.0 (X11; U; Linux i686; xx; rv:1.9b5) Gecko/2008052519 CentOS/3.0b5-0.beta5.6.el5.centos Firefox/3.0b5
Alpha example:
Mozilla/5.0 (Android 4.3.1; rv:6.0) Gecko/20100101 Firefox/26.0prealpha
from useragentparser.
WhichBrowser can provide the version in two ways:
- A string that is meant to be displayed on screen
- A string that is contains a version number - same specificity as the UA but reformatted
Sometimes the display string contains a prefix and the version number. Sometimes just an alias. And sometimes just the major version.
For example:
- On OS X: "Yosemite 10.10" and "10.10"
- On Windows: "XP" and "5.1"
- And for Chrome: "30" and "30.0.1599.17"
from useragentparser.
This should be fixed now with PR #38
- complete is always used
as is
- the hydration of major/minor/patch/alias was refactored that it should cover most cases
- major/minor/patch is still number only
- alias is populated when there is something else than number provided and not alpha/beta/...
from useragentparser.
Related Issues (20)
- Remove provider: Wurfl
- New Provider: nfriedly/whatsmyua.com HOT 2
- Nice dumper HOT 2
- Include whether the operating system is 64 bit or 32 bit HOT 6
- This package requires thadafinser/package-info but does not appear to use it. HOT 1
- Ua cutted
- Project still alive? Test page uses extremely old data files HOT 1
- package not compatible with composer v2 HOT 3
- piwik/device-detector is abandoned
- PHP 8 support
- new Provider: Wolfcast/BrowserDetection HOT 2
- Provide an option, to disable generic remove
- PiwikDeviceDetector Provider error HOT 2
- Integration test for `urlencode()` or `rawurlencode()` HOT 1
- Change isRealResult() to getRealResult() HOT 1
- WhatIsMyBrowserCom update
- composer autoload issue HOT 21
- New provider: 51degrees HOT 1
- New provider: DetectRight HOT 1
- New provider: endorphin-studio/browser-detector HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from useragentparser.