An upgrade file contains instructions to upgrade certain version of JoomSEF.
Its name has to be in format #.#.#.php, where #.#.# is JoomSEF version that the upgrade file will be used for.
You specify upgrade instructions by using two functions - AddSQL for SQL queries and AddFileOp for file operations.
AddSQL has only one parameter - a string with SQL query to execute.
AddFileOp has three parameters - path to file to perform the operation on, relative to joomla's home directory
- operation to perform, can be 'delete' or 'upgrade'
- path to source file in case that 'upgrade' operation is used
AddScript has one parameter - path to script file to execute
Example:
We have JoomSEF 1.2.5, we've made changes in admin.sef.php and we've altered a jos_redirection table. New version will be 1.2.6.
We create a file 1.2.5.php and we put following lines inside:
<?php
AddFileOp ('/administrator/components/com_sef/admin.sef.php', 'upgrade', '/admin.sef.php');
AddFileOp ('/administrator/components/com_sef/config.sef.php', 'upgrade', '/config.sef.php');
AddSQL("ALTER TABLE #__redirection ADD novysloupec varchar(10) not null");
AddScript('/dbfix.php');
?>
Note: File config.sef.php should not be present in any upgrade.