Actions

J2.5

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

From Joomla! Documentation

m (Created page with "== Normal update sequence == * Previous state: no democompupdate component installed * Install 1.0 ** Verify install is good by text echoed in back-end. ** Front-end: verify dat...")
 
m
Line 1: Line 1:
 
== Normal update sequence ==
 
== Normal update sequence ==
  
* Previous state: no democompupdate component installed
+
You can use the following sequence to show the effects of this example.  You may also try installs, updates and uninstalls in any sequence that you desire.
* Install 1.0
+
 
 +
* Previous state: no com_democompupdate component installed.
 +
* Install democompupdate_10.zip.
 
** Verify install is good by text echoed in back-end.
 
** Verify install is good by 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: MysqlAdmin: verify:
*** democompupdate_mytable exists and has one row, value '1.0'
+
*** democompupdate_mytable exists and has one row, value '1.0'.
*** extensions table has entry for com_democompupdate
+
*** 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'.
  
* Previous state: version 1.0 installed
+
* Previous state: version 1.0 installed.
* Install 1.1.1
+
* Install democompupdate_111.zip.
 
** Verify install is good by text echoed in back-end.
 
** Verify install is good by 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: MysqlAdmin: verify:
*** democompupdate_mytable exists and has one row, value '1.1.1'
+
*** democompupdate_mytable exists and has one row, value '1.1.1'.
*** extensions table has entry for com_democompupdate
+
*** 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'.
  
* Previous state: version 1.1.1 installed
+
* Previous state: version 1.1.1 installed.
* Install 1.3
+
* Install democompupdate_13.zip.
 
** Verify install is good by text echoed in back-end.
 
** Verify install is good by 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: MysqlAdmin: verify:
 
*** democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
 
*** democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
*** extensions table has entry for com_democompupdate
+
*** 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'.
  
 
== Try a reverse-sequence update ==
 
== Try a reverse-sequence update ==
  
Previous state: version 1.3 installed
+
* Previous state: version 1.3 installed.
Install 1.0
+
* Install democompupdate_10.zip.
Update should fail, give useful information in the back-end.
+
** Update should fail, give useful information in the back-end.
No change should be seen in front-end, back-end or MySqlAdmin.
+
** No change should be seen in front-end, back-end or MySqlAdmin.
  
 
== Make sure that uninstall works ==
 
== Make sure that uninstall works ==
  
Previous state: version 1.3 installed
+
* Previous state: version 1.3 installed.
Uninstall 1.0
+
* Uninstall 1.0
Verify component does not exist in Joomla extension manager, front-end
+
** Verify component does not exist in Joomla extension manager, front-end.
optional: MysqlAdmin: verify that democompupdate elements are gone.
+
** optional: MysqlAdmin: verify that democompupdate elements are gone.
  
 
== Verify full installs of each revision work correctly ==
 
== Verify full installs of each revision work correctly ==
  
Previous state: no democompupdate component installed
+
* Previous state: no democompupdate component installed.
Install 1.1.1
+
* Install democompupdate_111.zip.
Verify that the full install created the same database and file state as the update to 1.1.1.
+
** 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
+
* Previous state: version 1.1.1 installed.
Uninstall
+
* Uninstall
Install 1.3
+
* Install 1.3
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.
  
 
== Verify that Joomla version check works ==
 
== Verify that Joomla version check works ==
  
Previous state: version 1.3 installed
+
* Previous state: version 1.3 installed.
Uninstall
+
* Uninstall
Install 1.0J3
+
* Install democompupdate_10j3.zip.
Update should fail, give useful information in the back-end.
+
** 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.
+
** No evidence of the installed component should exist in front-end, back-end or MySqlAdmin.
  
 
== 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 instll the component improperly.
 
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 instll the component improperly.
 
* Create update SQL files for component revisions.  Follow the version string sequencing that is documented in the PHP version_compare function.  Create empty update SQL files if no SQL change is required for that version.
 
* Create update SQL files for component revisions.  Follow the version string sequencing that is documented in the PHP version_compare function.  Create empty update SQL files if no SQL change is required for that version.
Line 71: Line 74:
 
* 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 version string in the script.php file for each version.  Modify the custom code in this file, if needed, for each version.
  
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 that you have implemented.
+
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 that you have implemented.  You can implement your custom code in this example, and verify that it works correctly.

Revision as of 10:21, 31 May 2011

Contents

Normal update sequence

You can use the following sequence 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 install is good by text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
    • optional: MysqlAdmin: verify:
      • democompupdate_mytable exists and has one row, value '1.0'.
      • 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 install is good by text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
    • optional: MysqlAdmin: verify:
      • democompupdate_mytable exists and has one row, value '1.1.1'.
      • 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 install is good by text echoed in back-end.
    • Front-end: verify database, files and parameter setting.
      • There should be three rows in the table.
    • optional: MysqlAdmin: verify:
      • democompupdate_mytable exists and has three rows, values '1.1.1', '1.2.1' and '1.3'.
      • 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

  • 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 front-end, back-end or MySqlAdmin.

Make sure that uninstall works

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

Verify full installs of each revision work correctly

  • 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
  • Install 1.3
    • Verify that the full install created the same database and file state as the update to 1.3.

Verify that Joomla version check works

  • Previous state: version 1.3 installed.
  • Uninstall
  • Install democompupdate_10j3.zip.
    • 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

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 instll the component improperly.

  • Create update SQL files for component revisions. Follow the version string sequencing that is documented in the PHP version_compare function. Create empty update SQL files if no SQL change is required for that 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.

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 that you have implemented. You can implement your custom code in this example, and verify that it works correctly.