I do not like regexp and although at first glance the solution with regular expressions in targetPlatform seemed to be local, but it is not very convenient.
For example, I have an extension for 3.7.5
which regular to write what would be available in Joomla 3.9.0
, but not available in 3.7.3
To be honest, I already broke my whole head over it. In addition, the numbers are already double digits even in minor
Can better do version_compare
In order not to break the old system, this can be done as a separate attribute. etc min_version
Labels |
Added:
?
|
Title |
|
Labels |
Added:
?
|
@mbabker Why not?
We can add save the old system and add new.
ect
if ($product == $this->currentUpdate->targetplatform['NAME'] &&
&& preg_match('/^' . $this->currentUpdate->targetplatform['VERSION'] . '/', JVERSION)
&& $patchMinimumSupported
&& $patchMaximumSupported
&& $newCheck )
In new check we can add new attibutes.
min_version
- Joomla minimal version (version_compare)max_version
- Joomla maximal version (version_compare)exclude
- regexp for exclude some bag versionThis can be added already in 3.x and then simply transferred to 4.x
P.S However, what exactly needs to be written in xml is to indicate the minimum version of joomla 3.10.12+
for example.
Your $newCheck
would never be executed without adding an immediately deprecated attribute to specify the version checking strategy (regex or version comparison), you can't write a check that uses the existing version attribute as both a regex and version comparison strategy and it just work.
Realistically you should never need a max version attribute. If it were being done this right, as I said, Joomla would use Composer's SAT resolver system and use version ranges and a conflict/exclude attribute to specify conflicting versions (with core and other extensions). So you would only need to specify ^3.7.5
for your extension to state that it works on any 3.x release as of 3.7.5, you shouldn't need to specify minimum version 3.7.5 as some arbitrary attribute and maximum version as some arbitrary number or some fake number like 3.99.999 to block 4.0 installs (as the SAT resolver respects Semantic Versioning and wouldn't resolve to a 4.0 version until you explicitly specify it, i.e. ^3.7.5|~4.0
).
So, version compare really is a step backwards as long as Joomla is using an XML oriented system where core has to download a file and process that file itself (and that IMO is a huge design flaw that will never be fixed). Part of what makes regex more useful for the update server definitions, as currently designed, is it is easier to block showing updates on sites with specific versions. The version compare strategy is basically "is site version newer or the same as this", which removes the ability to blacklist versions without adding more tags and/or attributes (and because core itself processes the update definitions, this means you can only rely on a feature in the update server if your extension is only supporting the version that was added in), and you're left implementing more logic into your extension's install script to compensate for things that could/should be handled in the update server system.
@mbabker I would love to check everything on the server side and give only the most suitable version.
But without extaQuery, Joomla does not transmit anything that could help.
If Joomla sent the necessary information to the update server, for example, the core version, the site’s domain, these extensions (version, element), etc., then I could only give the version that I find necessary, and not compose 20 complex and confusing xml
Status | New | ⇒ | Discussion |
Category | ⇒ | Feature Request |
Labels |
Added:
J3 Issue
|
Labels |
Removed:
?
|
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-07-04 08:56:00 |
Closed_By | ⇒ | joomla-cms-bot |
Closed_By | joomla-cms-bot | ⇒ | alikon |
Labels |
Added:
?
|
Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/23321
lack of interest
Labels |
Added:
?
Removed: ? |
lack of interest
AFAIR it is changed to a version comparison in 4.0 and can’t change at all
in 3.x because there is no way to sanely have regex and version compare to
live side by side without some deprecated transition attribute.
TBH regex is still the right way to go about it because right now there is
no way to conflict a single version (say 3.8.7 had a bug that broke your
extension, we don’t have a system that can blacklist only 3.8.7 without
crazy update server definitions). You practically need Composer’s SAT
Resolver and its require/conflict rules to do things in the most friendly
way possible.
On Sat, Dec 22, 2018 at 6:51 PM Igor Berdichevskiy notifications@github.com
wrote:
--