Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.7.4 Compatibility With PHP 8.0+ #961

Closed
semrocc opened this issue Aug 20, 2024 · 10 comments
Closed

3.7.4 Compatibility With PHP 8.0+ #961

semrocc opened this issue Aug 20, 2024 · 10 comments

Comments

@semrocc
Copy link

semrocc commented Aug 20, 2024

As I am not familiar with Composer, and version 4.8 looks overly complicated for myself, a non-programmer, I was wondering if version 3.7.4+ will continue to work with PHP 8.0+

Currently, I have tested version 3.7.4 with PHP 8.3, and there does not appear to be any problems. I would just like to confirm that 3.7.4 will continue to be PHP 8.0+ compatible. Thanks

@ryanwhowe
Copy link

@semrocc the documentation shows that the 3.74 version is not intended to support PHP 8 (it states <8.0), so you are in a "use at your own risk" situation. I would consider the 3.74 current composer.json file to have a bug in the required php verison setting. Currently, it shows >= 7.0 while it should be ^7.0 to exclude support for php 8. It appears that you are only able to install it in php 8 via composer due to an oversight in the composer.json setting.

@semrocc
Copy link
Author

semrocc commented Oct 15, 2024

@ryanwhowe thanks for this information. Currently I only call the MobileDetect.php file and then some variation of:

if ($detect->isMobile() && !$detect->isTablet())

Do you expect that the MobileDetect.php file will continue to work with future versions of PHP 8+?

@ryanwhowe
Copy link

@semrocc looking through the code briefly there are no forward issues that I see with php ^8.0 support. At its heart, the package is a header parser with an extensive library of mobile and tablet snippets that indicate different types of browsers. Our usage is similar to yours but we are slowly transitioning to just utilizing css and view ports instead of modifying our backed behavior based on the requester's header browser.

@semrocc
Copy link
Author

semrocc commented Oct 15, 2024

@ryanwhowe thanks for this information, much appreciated.

@Xon
Copy link

Xon commented Oct 16, 2024

The 3.74.x branch works with php 8.0 to php 8.3, but isn't compatible with php 8.4+ (ref #956). Sadly the PR I had for 3.74.x wasn't accepted

@semrocc
Copy link
Author

semrocc commented Oct 16, 2024

Having the 3.7.4 versions compatible with versions of PHP 8.4+ would certainly be nice for people like myself as Mobile Detect versions 4.8+ will simply not be an option for me.

@Apollodore
Copy link

@semrocc version 4.8 is easier now @serbanghita has made a standalone version

@serbanghita
Copy link
Owner

@semrocc I've made it so you can use Mobile Detect with PHP 8.x standalone just a couple of days ago. I've put the steps here: https://docs.mobiledetect.net/home/usage-standalone

@ryanwhowe @Apollodore thank you for the assist 🙏

@semrocc
Copy link
Author

semrocc commented Dec 15, 2024

@serbanghita This sounds great - thanks for your work.

Can you tell me which files/directories are required for the standalone configuration?

@Apollodore
Copy link

@serbanghita you are welcome, thank you so much for your work.
@semrocc all files and directories of 4.8.10 version are required (maybe not, I am also a non-programmer, but it works if you keep all the files and directories). As @serbanghita told, he has put the steps here: https://docs.mobiledetect.net/home/usage-standalone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants