-
Notifications
You must be signed in to change notification settings - Fork 30
001b. Adding an update server and a changelog
Surely you will develop your component further. How do you make sure that your customers always use the latest version? How do they know about an update?
Since Joomla! 2.5.4 there is a possibility in Joomla! to offer updates for extensions. Also, a Joomla! Core Update can be made directly from the back end without having to download and upload the package itself.
This chapter explains how to create and run an update server for your component.
Update Server sounds a bit complicated, basically it's just a URL to an XML file specified in the installation XML file. This XML file then contains a number of details, including the new version and the download URL which Joomla! can read out. If Joomla! finds an update this will be displayed in the back end.
In the next picture you can see this update note in the section Extensions | Update
. Since Joomla 4.0, extension developers can leverage the ability of Joomla to read a changelog file and give a visual representation of the changelog. If a given version is not found in the changelog, the changelog button will not be shown. You only see the text N/A
.
In the next picture there is a changelog for the new version.
What has changed in the last update shows you the Manage View in the Extension Manager.
And in the last picture you can see what the changelog looks like.
Joomla! has a built-in update software that allows you to easily update your core Joomla! version. This update mechanism is also available to third-party Joomla! extensions. However, you need to set up an update server.
You can try this out on your local development environment. To do so, you will need a Joomla! site, which will be your site that you are going to try to update the extension on. The update server could be any folder on your local web server.
Install version 1.0.0 of our component. To enable the update manager to be able to check for updates, you need to create a new version.
Newly created files
Modified files
administrator/components/com_foos/foos.xml
Click here to see all changes compared to the last chapter.
<changelogs>
<changelog>
<element>com_foos</element>
<type>component</type>
<version>1.0.0</version>
<note>
<item>Initial Version</item>
</note>
</changelog>
<changelog>
<element>com_foos</element>
<type>component</type>
<version>1.0.1</version>
<security>
<item><![CDATA[<p>No security issues.</p>]]></item>
</security>
<fix>
<item>No fix</item>
</fix>
<language>
<item>English</item>
</language>
<addition>
<item>Change log and Update Server added.</item>
</addition>
<change>
<item>No change</item>
</change>
<remove>
<item>No remove</item>
</remove>
<note>
<item>Change log and Update Server added.</item>
</note>
</changelog>
</changelogs>
See https://github.com/joomla/joomla-cms/pull/24026 and https://docs.joomla.org/Adding_changelog_to_your_manifest_file for more information concerning the changelog.
<updates>
<update>
<name>com_foos</name>
<description>This is com_foo</description>
<element>com_foos</element>
<type>component</type>
<version>1.0.1</version>
<changelogurl>https://raw.githubusercontent.com/astridx/boilerplate/tutorial/changelog.xml</changelogurl> <infourl title="agosms">https://github.com/astridx/boilerplate/blob/v1.0.1/README.md</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/astridx/boilerplate/releases/download/v1.0.1/com_foos-1.0.1.zip</downloadurl>
</downloads>
<maintainer>Foo Creator</maintainer>
<maintainerurl>http://www.example.com</maintainerurl>
<targetplatform name="joomla" version="4.*"/>
<php_minimum>7.1</php_minimum>
</update>
</updates>
administrator/components/com_foos/foos.xml
In this file we have to change the version number.
https://docs.joomla.org/Adding_changelog_to_your_manifest_file
https://github.com/joomla/joomla-cms/pull/24026
https://docs.joomla.org/Adding_changelog_to_your_manifest_file
http://docs.joomla.org/Deploying_an_Update_Server
https://github.com/joomla/joomla-cms/pull/15185
Now you can zip all files and install them via Joomla Extension Manager.
Now we have . Up to now we have no . We are going to work on this in the next chapter.