Open pepebe opened 9 years ago
can this not be accomplished with php's version_compare() and $modx->getVersionData()?
Easy way to know 2.2 or 2.3 in manager JS: MODx.config.connector_url is undefined in 2.2
@exside: Thanks, I can see that http://rtfm.modx.com/revolution/2.x/developing-in-modx/other-development-resources/class-reference/modx/modx.getversiondata is quite useful, but it solves the problem on a php level, which might not always be an option.
@argnist. Neat :) It totally beats substr(getVersionData['full_version'], 0, 3);
Including a library for such a limited use case seems like overkill; generally feature detection would be preferred to version sniffing as well I'd say.
Removing from the 3.0 milestone.
Don't know if this has already been done, but I have a humble feature request.
Considering a bunch of problems migrating packages, snippets and plugins for from revo 2.2 to 2.3 (example: https://github.com/modxcms/revolution/issues/831), I vote for something like "version_compare" (http://phpjs.org/functions/version_compare/) to be included in the core.
Its very useful and I see home-grown solutions for this problem in a lot if places.
Cheers,
pepebe