J3 Issue ? ?
avatar Septdir
Septdir
22 Dec 2018

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

avatar Septdir Septdir - open - 22 Dec 2018
avatar joomla-cms-bot joomla-cms-bot - change - 22 Dec 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 22 Dec 2018
avatar Septdir Septdir - change - 23 Dec 2018
Title
[RTC] Updating Server targetplatform regexp to version_compare
[RFC] Updating Server targetplatform regexp to version_compare
avatar Septdir Septdir - edited - 23 Dec 2018
avatar joomla-cms-bot joomla-cms-bot - change - 23 Dec 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Dec 2018
avatar mbabker
mbabker - comment - 23 Dec 2018

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:

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


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#23321, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoXyLkBPEXIA7yLMjC4K28oPrxeclks5u7sVlgaJpZM4Zfpu5
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar Septdir
Septdir - comment - 23 Dec 2018

@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.

  1. min_version - Joomla minimal version (version_compare)
  2. max_version - Joomla maximal version (version_compare)
  3. exclude - regexp for exclude some bag version

This 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.

avatar mbabker
mbabker - comment - 23 Dec 2018

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.

avatar Septdir
Septdir - comment - 23 Dec 2018

@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

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Category Feature Request
avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Apr 2019
Labels Added: J3 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 4 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jul 2019
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Jul 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-07-04 08:56:00
Closed_By joomla-cms-bot
avatar alikon alikon - change - 4 Jul 2019
Closed_By joomla-cms-bot alikon
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - close - 4 Jul 2019
avatar joomla-cms-bot joomla-cms-bot - unlabeled - 4 Jul 2019
avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Jul 2019

Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/23321

avatar alikon
alikon - comment - 4 Jul 2019

lack of interest


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23321.

avatar joomla-cms-bot joomla-cms-bot - change - 4 Jul 2019
Labels Added: ?
Removed: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 4 Jul 2019
avatar alikon
alikon - comment - 4 Jul 2019

lack of interest


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/23321.

Add a Comment

Login with GitHub to post a comment