Problem / Motivation
We Create a service that loads the Mobile_Detect library.
Solution
Create a service to abstract the Mobile_Detect library, probably as a thin class w/ an interface. However, I am not sure how/if you can avoid using a singleton here, which would make unit testing the service harder.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 2627514-mobile-detect-service.patch | 600 bytes | darol100 |
Comments
Comment #2
darol100 commentedI will give this a shot sometime this week. Assigned to myself.
Comment #3
darol100 commentedChanging the description a little bit. I do not think (IMO), that we do not need a necessary to have an interface for this module since this module is specific to Mobile_detect.php library.
Adding the patch that allows having the Mobile_detect library as service.
If you wish to test this patch here is the usage of the service.
Comment #4
mpdonadioMy only thought here is that if we do this as a thin wrapper to \Mobile_Detect, then we can add methods to handle the quirks like having to check for both isMobile() and isTable() when we explicitly want just handhelds.
Comment #5
darol100 commentedComment #6
darol100 commentedComment #7
nonom commentedIt's done in 8.x-2.x branch
So you can use:
Comment #8
nonom commentedComment #9
nonom commented