Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki WOX xoops XoopsEngine ZendFramework

New Users

Registering user

# 133971

bitwww

Welcome to XOOPS!
[Main Page]

Dev:xoops install uninstall

From XOOPS Web Application System

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Categories: Development | DevWiki

onInstall, onUninstall, onUpdate

The module installation system features a way for mods to specify a custom installation / uninstallation script that will be called once the kernel has finished its own work. In xoops_version.php:

   $modversion['onInstall'] = 'install_funcs.php';
   $modversion['onUninstall'] = 'install_funcs.php';
   $modversion['onUpdate'] = 'install_funcs.php';

Then in install_funcs.php:

$xoopsMod is $XoopsModule object of that module.

   function xoops_module_install_<DIRNAME>( $xoopsMod ) {
       if (everythingIsOK) {
           return true;
       } else {
           return false;
       }
   }
   function xoops_module_uninstall_<DIRNAME>( $xoopsMod ) {
       if (everythingIsOK) {
           return true;
       } else {
           return false;
       }
   }
   function xoops_module_update_<DIRNAME> ( $xoopsMod, $oldversion) {
       switch ($oldversion) { //remember that version is multiplied with 100 to get an integer
           case 100: //perform actions to upgrade from version 1.00
               break;
           case 110: //perform actions to upgrade from version 1.10
               break;
       }
   }


Back to the dev:Main Page

Retrieved from "http://xoops.org/modules/mediawiki/index.php/Dev:xoops_install_uninstall"

This page has been accessed 4,684 times. This page was last modified 03:21, 20 August 2009. Content is available under XOOPS Web Application System.