Archived

Difference between revisions of "Managing Component Updates (How to use this example)"

From Joomla! Documentation

(Remove 1.6 and 1.7 tags)
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{review}}
+
{{version/tutor|2.5}}{{Chunk:Managing Component Updates - Contents}}{{review}}
This tutorial is for Joomla {{JVer|1.6}}
+
You will need to download all four versions of this example to exercise all of the features.
== Articles in this series ==
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_1|Overview]]
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_2|Manifest file]]
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_3|Script.php]]
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_4|Update SQL files]]
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_5|Component release files]]
 
* [[Managing_Component_Updates_with_Joomla!1.6_-_Part_6|How to use this example]]
 
  
 
== Normal update sequence ==
 
== Normal update sequence ==
  
You can use the following sequence of installs, updates and uninstalls, to show the effects of this example.  You may also try installs, updates and uninstalls in any sequence that you desire.
+
You can use the following sequence of installs, updates and uninstalls to show the effects of this example.  You may also try installs, updates and uninstalls in any sequence that you desire.
  
 
* Previous state: no com_democompupdate component installed.
 
* Previous state: no com_democompupdate component installed.
Line 17: Line 10:
 
** Verify the install is good by the text echoed in back-end.
 
** Verify the install is good by the text echoed in back-end.
 
** Front-end: verify database, files and parameter setting.
 
** Front-end: verify database, files and parameter setting.
** optional: MysqlAdmin: verify:
+
** optional: phpMyAdmin: verify:
*** democompupdate_mytable exists and has one row, value '1.0'.
+
*** jos_democompupdate_mytable exists and has one row, myvalue = '1.0'.
*** extensions table has entry for com_democompupdate.
+
*** jos_extensions table has entry for com_democompupdate.
 
**** params field (JSON), has three values.
 
**** params field (JSON), has three values.
 
**** manifest_cache field (JSON) shows version '1.0'.
 
**** manifest_cache field (JSON) shows version '1.0'.
Line 26: Line 19:
 
* Previous state: version 1.0 installed.
 
* Previous state: version 1.0 installed.
 
* Install democompupdate_111.zip.
 
* Install democompupdate_111.zip.
** Verify the install is good by the text echoed in back-end.
+
** Verify the update is good by the text echoed in back-end.
 
** Front-end: verify database, files and parameter setting.
 
** Front-end: verify database, files and parameter setting.
** optional: MysqlAdmin: verify:
+
** optional: phpMyAdmin: verify:
*** democompupdate_mytable exists and has one row, value '1.1.1'.
+
*** jos_democompupdate_mytable exists and has one row, value '1.1.1'.
*** extensions table has entry for com_democompupdate.
+
*** jos_extensions table has entry for com_democompupdate.
 
**** params field (JSON), has three values.
 
**** params field (JSON), has three values.
 
**** manifest_cache field (JSON) shows version '1.1.1'.
 
**** manifest_cache field (JSON) shows version '1.1.1'.
Line 37: Line 30:
 
* Previous state: version 1.1.1 installed.
 
* Previous state: version 1.1.1 installed.
 
* Install democompupdate_13.zip.
 
* Install democompupdate_13.zip.
** Verify the install is good by the text echoed in back-end.
+
** Verify the update is good by the text echoed in back-end.
 
** Front-end: verify database, files and parameter setting.
 
** Front-end: verify database, files and parameter setting.
 
*** There should be three rows in the table.
 
*** There should be three rows in the table.
** optional: MysqlAdmin: verify:
+
** optional: phpMyAdmin: verify:
*** democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
+
*** jos_democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
*** extensions table has entry for com_democompupdate.
+
*** jos_extensions table has entry for com_democompupdate.
 
**** params field (JSON), has three values.
 
**** params field (JSON), has three values.
 
**** manifest_cache field (JSON) shows version '1.3'.
 
**** manifest_cache field (JSON) shows version '1.3'.
Line 56: Line 49:
  
 
* Previous state: version 1.3 installed.
 
* Previous state: version 1.3 installed.
* Uninstall 1.0
+
* Uninstall com_democompupdate
 
** Verify the component does not exist in Joomla extension manager or front-end.
 
** Verify the component does not exist in Joomla extension manager or front-end.
** optional: MysqlAdmin: verify that democompupdate elements are gone.
+
** optional: phpMyAdmin: verify that democompupdate elements are gone.
  
 
== Verify full installs of each revision work correctly ==
 
== Verify full installs of each revision work correctly ==
Line 68: Line 61:
  
 
* Previous state: version 1.1.1 installed.
 
* Previous state: version 1.1.1 installed.
* Uninstall
+
* Uninstall com_democompupdate
 +
** Verify the component does not exist in Joomla extension manager or front-end.
 +
** optional: phpMyAdmin: verify that democompupdate elements are gone.
 +
 
 +
 
 +
* Previous state: no democompupdate component installed.
 
* Install democompupdate_13.zip.
 
* Install democompupdate_13.zip.
 
** Verify that the full install created the same database and file state as the update to 1.3.
 
** Verify that the full install created the same database and file state as the update to 1.3.
Line 75: Line 73:
  
 
* Previous state: version 1.3 installed.
 
* Previous state: version 1.3 installed.
* Uninstall
+
* Uninstall com_democompupdate
 
* Install democompupdate_10j3.zip.
 
* Install democompupdate_10j3.zip.
 
** The update should fail, give useful information in the back-end.
 
** The update should fail, give useful information in the back-end.
Line 82: Line 80:
 
== Summary ==
 
== Summary ==
  
If the update requirements for your component allow you to follow the standard release sequencing, then you can use the update features in Joomla 1.6 to ensure your users do not install the component improperly.
+
You can use the update features in Joomla 1.6 (and greater) to ensure that the web site administrator installs your component properly.
 
* Your component version string sequence must follow the requirements shown in the PHP ''version_compare'' function.
 
* Your component version string sequence must follow the requirements shown in the PHP ''version_compare'' function.
* Create update SQL files for component revisions.  The file names must match your version strings.  Create an empty update SQL file if no SQL change is required for that version.
+
* Create update SQL files for component revisions.  The file names must match your version strings.
 
* Update the version string in the manifest file for each version.
 
* Update the version string in the manifest file for each version.
* Update the version string in the script.php file for each version. Modify the custom code in this file, if needed, for each version.
+
* Update the required Joomla version in the manifest file, if you will use it in the script.php file to enable installs and updates.
 +
* Modify the custom PHP code in the script.php file, if needed, for each version.
 +
 
 +
If your component requires non-standard update handling, you can implement it in the script.php file.  You can disable the normal update SQL file execution and implement your own code.  You can implement custom checks and custom install and update actions.  You can, and should create confirmation messages and error messages to help the web site administrator understand what your code is doing.
 +
 
 +
I intentionally made this example simple, to make debugging easier. You can implement your custom code in this example, verify that it works correctly, then implement it in your component.  Share your successes with the Joomla community.
  
If your component requires unusual update handling, you can implement it in the script.php file.  You can disable the normal update SQL file execution and implement your own code.  You can implement custom checks and custom install and update actions.  You can, and should, create confirmation messages and error messages to help the administrator understand the actions in your code.
+
== Contributors ==
 +
*[[User:sm990|Kim Eckert]]
  
I intentionally made this example simple, to make debug easier. You can implement your custom code in this example, and verify that it works correctly, then implement it in your component. Share your successes with the Joomla community.
+
[[Category:Joomla! 1.6]]
 +
[[Category:Joomla! 1.7]]
 +
[[Category:Joomla! 2.5]]
 +
[[Category:Component Development]]

Revision as of 08:03, 29 April 2013

This page has been archived. This page contains information for an unsupported Joomla! version or is no longer relevant. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

<sidebar>

  • Managing Component Updates
    • J2.5:Managing Component Updates|Overview
    • J2.5:Managing Component Updates (Manifest file)|Manifest file
    • J2.5:Managing Component Updates (Script.php)|Script.php
    • J2.5:Managing Component Updates (Update SQL files)|Update SQL files
    • J2.5:Managing Component Updates (Component release files)|Component release files
    • J2.5:Managing Component Updates (How to use this example)|How to use this example
  • Help
    • JDOC:How to Contribute to Joomla! Documentation|Contribute to Joomla! Docs
    • JDOC:Documentation_Translators|Translate Joomla! Docs
    • Help:Cheatsheet|Editing Help
    • Sandbox|Play in the Sandbox
    • JDOC:Wiki_policy|JDOC's Policies
    • JEDL|Documentation License
    • helppage|More Help

</sidebar>

Copyedit.png
This Page Needs Your Help

This page is tagged because it NEEDS REVIEW. You can help the Joomla! Documentation Wiki by contributing to it.
More pages that need help similar to this one are here. NOTE-If you feel the need is satistified, please remove this notice.


You will need to download all four versions of this example to exercise all of the features.

Normal update sequence[edit]

You can use the following sequence of installs, updates and uninstalls to show the effects of this example. You may also try installs, updates and uninstalls in any sequence that you desire.

  • Previous state: no com_democompupdate component installed.
  • Install democompupdate_10.zip.
    • Verify the install is good by the text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
    • optional: phpMyAdmin: verify:
      • jos_democompupdate_mytable exists and has one row, myvalue = '1.0'.
      • jos_extensions table has entry for com_democompupdate.
        • params field (JSON), has three values.
        • manifest_cache field (JSON) shows version '1.0'.


  • Previous state: version 1.0 installed.
  • Install democompupdate_111.zip.
    • Verify the update is good by the text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
    • optional: phpMyAdmin: verify:
      • jos_democompupdate_mytable exists and has one row, value '1.1.1'.
      • jos_extensions table has entry for com_democompupdate.
        • params field (JSON), has three values.
        • manifest_cache field (JSON) shows version '1.1.1'.


  • Previous state: version 1.1.1 installed.
  • Install democompupdate_13.zip.
    • Verify the update is good by the text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
      • There should be three rows in the table.
    • optional: phpMyAdmin: verify:
      • jos_democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
      • jos_extensions table has entry for com_democompupdate.
        • params field (JSON), has three values.
        • manifest_cache field (JSON) shows version '1.3'.

Try a reverse-sequence update[edit]

  • Previous state: version 1.3 installed.
  • Install democompupdate_10.zip.
    • Update should fail, give useful information in the back-end.
    • No change should be seen in the front-end, back-end or MySqlAdmin.

Make sure that uninstall works[edit]

  • Previous state: version 1.3 installed.
  • Uninstall com_democompupdate
    • Verify the component does not exist in Joomla extension manager or front-end.
    • optional: phpMyAdmin: verify that democompupdate elements are gone.

Verify full installs of each revision work correctly[edit]

  • Previous state: no democompupdate component installed.
  • Install democompupdate_111.zip.
    • Verify that the full install created the same database and file state as the update to 1.1.1.


  • Previous state: version 1.1.1 installed.
  • Uninstall com_democompupdate
    • Verify the component does not exist in Joomla extension manager or front-end.
    • optional: phpMyAdmin: verify that democompupdate elements are gone.


  • Previous state: no democompupdate component installed.
  • Install democompupdate_13.zip.
    • Verify that the full install created the same database and file state as the update to 1.3.

Verify that Joomla version check works[edit]

  • Previous state: version 1.3 installed.
  • Uninstall com_democompupdate
  • Install democompupdate_10j3.zip.
    • The update should fail, give useful information in the back-end.
    • No evidence of the installed component should exist in front-end, back-end or MySqlAdmin.

Summary[edit]

You can use the update features in Joomla 1.6 (and greater) to ensure that the web site administrator installs your component properly.

  • Your component version string sequence must follow the requirements shown in the PHP version_compare function.
  • Create update SQL files for component revisions. The file names must match your version strings.
  • Update the version string in the manifest file for each version.
  • Update the required Joomla version in the manifest file, if you will use it in the script.php file to enable installs and updates.
  • Modify the custom PHP code in the script.php file, if needed, for each version.

If your component requires non-standard update handling, you can implement it in the script.php file. You can disable the normal update SQL file execution and implement your own code. You can implement custom checks and custom install and update actions. You can, and should create confirmation messages and error messages to help the web site administrator understand what your code is doing.

I intentionally made this example simple, to make debugging easier. You can implement your custom code in this example, verify that it works correctly, then implement it in your component. Share your successes with the Joomla community.

Contributors[edit]