Sunday, May 23, 2010

Cubi module enhancement

The goal of Cubi module is to allow developers to write their own components and plug in to Cubi application. So each module should have its own
  • module description information
  • database tables and preload data
  • menu definition. menu tells users where to access the module functionality
  • depend-on modules who need to be installed before this module
Let's see how cubi enhance its module management. The mod.xml is the main description file. It schema has 3 major part:
  1. ACL
  2. Menu
  3. Dependency
Sample mod.xml can be found in cubi/modules/help/mod.xml

Developer can add the module specific sql in
  • mod.install.sql and
  • mod.uninstall.sql
Cubi provides a command line tool to load module. The command is cubi/install/load_module.php
# php load_module.php module_name

To help prepare fresh cubi installation data, developer can use script at cubi/install/create_cubidb.php
# php create_cubidb.php
This script create a fresh database called "cubi_install". You can dump the database to cubi/install/cubi.sql. This database will be used in installation wizard.

No comments:

Post a Comment