How does "Extension manager > find updates" work?

331 views
Skip to first unread message

Antanas Vipartas

unread,
Feb 10, 2012, 12:03:30 PM2/10/12
to joomla-de...@googlegroups.com
Hi, Could someone please explain the workflow Joomla uses for identifying NEW version when we click on Extensions > Extension manager > Update > Find updates?

Does it analyze <version> tag in the com_customextension_update.xml file? If yes, how does it compare two different versions? Like strings?

Here is my xml file, I created it using Joomla Component Tutorial (from docs.joomla.org). I didn't find any explanations on how to use other tags (i.e. <infourl>, <downloads>) and attributes (i.e. attributes for tag <platform>)

<?xml version="1.0" encoding="utf-8"?>
<updates>
    <update>
        <name>basketball</name>
        <description></description>
        <element>com_basketball</element>
        <type>component</type>
        <version>1.0</version>
        <infourl title="basketball URL">http://www.krepsiniopulsas.lt</infourl>
        <downloads>
            <downloadurl type="full" format="zip">http://www.krepsiniopulsas.lt/com_basketball_v1.0.zip</downloadurl>
        </downloads>
        <maintainer>Antanas Vipartas</maintainer>
        <maintainerurl>http://vipartas.lt</maintainerurl>
        <targetplatform name="joomla" version="2.5" />
    </update>
    <update>
        <name>basketball</name>
        <description></description>
        <element>com_basketball</element>
        <type>component</type>
        <version>1.1</version>
        <infourl title="basketball URL">http://www.krepsiniopulsas.lt</infourl>
        <downloads>
            <downloadurl type="full" format="zip">http://www.krepsiniopulsas.lt/com_basketball_v1.1.zip</downloadurl>
        </downloads>
        <maintainer>Antanas Vipartas</maintainer>
        <maintainerurl>http://vipartas.lt</maintainerurl>
        <targetplatform name="joomla" version="2.5" />
    </update>
</updates>


Mark Dexter

unread,
Feb 10, 2012, 12:12:32 PM2/10/12
to joomla-de...@googlegroups.com
I think the basic idea is to compare the folders (com_xxx, mod_xxx, plugins/xxx) with the #__extensions table. When an extension is installed, the program files are copied to the new folder and an entry it made in the #__extensions table. So, by comparing the two, you can tell if there is an extension folder that is missing a row in #__extensions.

There may be more to it, but I think that's the basic idea. Mark




--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/-4iar4_3CaMJ.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Mark Dexter

unread,
Feb 10, 2012, 12:13:15 PM2/10/12
to joomla-de...@googlegroups.com
Oops! I misread your question and answered how the Discover works, not the find updates. Sorry about that. Mark

Antanas Vipartas

unread,
Feb 10, 2012, 12:40:12 PM2/10/12
to joomla-de...@googlegroups.com
Now I'm able to see the new version in the update manager, because I pressed "Purge Cache". As I understood, it enables sites from table #__update_sites WHERE enabled = 0.

But the question remains: how are versions compared? Can I release version 1.9, and after that - 1.10? Will 1.10 be newer than 1.9? Because comparing like strings - it won't :)

Another question - does version date has some impact?

Andrea Tarr at Tarr Consulting

unread,
Feb 10, 2012, 12:54:37 PM2/10/12
to joomla-de...@googlegroups.com
Have you seen this?


It doesn't answer the compare question, but it does answer some of your other questions

Andy

Andrea Tarr

Tarr Consulting






--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.

Antanas Vipartas

unread,
Feb 10, 2012, 12:58:02 PM2/10/12
to joomla-de...@googlegroups.com
No, I haven't. Thank you very much!

Jeremy Wilken

unread,
Feb 10, 2012, 6:23:56 PM2/10/12
to joomla-de...@googlegroups.com
It uses the php version_compare() function to compare two strings. It does a pretty good job of picking the more recent version, except when someone throws in something like '1.3stable' or other non-version strings. That is a bad habit devs need to avoid, and one should use the same basic system as Joomla (#.#.#). Dates are not used in calculating anything about the most recent version, only the version number value.

You need to list a separate update item like in your example only when you have two different versions running on different versions of Joomla. If your 1.1 extensions was for Joomla 2.5 but 1.0 was only 1.7, then you should need two. I believe you only need the latest entry if they both run on 2.5 equally. The updater checks each of the version nodes, compares the versions, and then picks the latest version that matches the Joomla version declared in the targetplatform node.

Also, lets say you are an extension developer with 5 extensions. You can put them all on the same xml update server list. When someone installs one of your extensions, that update server is then recognized and pulled in. It will actually pull in notifications for the other 4 extensions on that list as well, but if it doesn't find an extension installed that matches they aren't displayed. There is no 'discover from update server' functionality in Joomla.

However in Square One (https://github.com/square-one/square-one-cms) I have added this to the installation process, so you would be able to see the 4 other extensions in a list of 'Available Extensions' to install remotely. The main issue at the moment is there is no way to know where all of these update servers are, but if you do know them, you can add one and get updates or install new ones that way.
Reply all
Reply to author
Forward
0 new messages