Closed BackuPs closed 11 months ago
@BackuPs the change was introduced on the 3.74.x
major version branch and tags.
No change has been performed on 2.8.x
branch and tags. So if a plugin wants to upgrade to 3.74.x
, they will have to change the way they include MobileDetect class into their code.
3.74.x
being a major version, I changed the name of the class to MobileDetect
in order to PSR-4 standard
I plan on keeping both 2.x
and 3.x
in sync for a while in terms of regexes.
Let me know your thoughts and suggestions.
Version | Status | Namespace | Code | PHP Version |
---|---|---|---|---|
2.8.x | \Mobile_Detect |
2.8 | >=5.0,<7.0 | |
3.74.x | Detection\MobileDetect |
3.74 | >=7.3,<8.0 |
Thank you for the information. I will recode my code snippets.
For anybody interested... a small code snippet.
if (class_exists('\Detection\MobileDetect')) { $mobiledetect = new \Detection\MobileDetect; if ( $mobiledetect->isMobile() ) { // do something ... } }
Have a good weekend & thank you !
Why is the classname renamed from Mobile_Detect to MobileDetect? Why is the filename renamed from Mobile_Detect.php to MobileDetect.php?
Themebuilders and pluginbuilders using mobile detect have to Change all code because of this.
What is the use of such change?
Even on the documentation you are writing New Mobile_Detect
http://mobiledetect.net/