This is an old revision of the document!


How to prepare modules for distribution

coreBOS is prepared to make installing and distributing your modules easy.

There are basically two approaches for this:

  1. distribute your module as an individual package that can be installed on any system once it is up and running
  2. distribute your module as part of the whole system and have it appear as an optional module for your users to select or as a mandatory module that will be installed

The first step of obtaining the package file must be done to be able to distribute it on installation.

Create module package

A coreBOS module package consists of a set of files that implement the functionality of the module and a manifest.xml file which details the necessary meta data and database changes that it needs. You can read more about this in other sections of the wiki.

Once your module is working as you like and you want to package it follow these steps:

1.- File structure

You must have these files in place:

  • build/{ModuleName}/manifest.xml
  • modules/{ModuleName}
  • cron/modules/{ModuleName} (optional only if needed)
  • Smarty/templates/modules/{ModuleName} (optional only if needed)

2.- Package the module

There are different ways to acheive this.

Linux shell access

If you have linux shell access you can easily obtain the zip package entering the build dirtectory and executing the pack script:

  • cd build
  • ./pack.sh {ModuleName}

Programed with Package Manager

Add the next script to the root of your coreBOS install and execute it from the command line or the browser.

Package getting meta data from database

<?php
// Turn on debugging level
$Vtiger_Utils_Log = false;

require_once 'include/utils/utils.php';
include_once('vtlib/Vtiger/Module.php');
global $current_user,$adb;
set_time_limit(0);
ini_set('memory_limit','1024M');

//Vtiger_Package::packageFromFilesystem('ConfigEditor',true);
Vtiger_Package::languageFromFilesystem('es_es','Spanish');

?>

Package getting meta data from manifest.xml file

<?php
// Turn on debugging level
$Vtiger_Utils_Log = false;

require_once 'include/utils/utils.php';
include_once('vtlib/Vtiger/Module.php');
global $current_user,$adb;
set_time_limit(0);
ini_set('memory_limit','1024M');

//Vtiger_Package::packageFromFilesystem('ConfigEditor',true);
Vtiger_Package::languageFromFilesystem('es_es','Spanish');

?>

coreBOS Documentación