This is an old revision of the document!
THIS DOCUMENTATION IS WRONG. It is obsolete. We're working on it
coreBOS (5.5 forward) is prepared to make installing and distributing your modules easy.
There are basically two approaches for this:
The first step is to create the new module in an existing system, so install a coreBOS system on your development machine and let's get started.
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:
You must have these files in place:
There are different ways to achieve this.
If you have linux shell access you can easily obtain the zip package entering the build dirtectory and executing the pack script:
For this to work you must add links to the main directories of your module inside the module's directory in build.
You can add the next script to the root of your coreBOS install and execute it from the command line or the browser to get the package.
The scripts below are the minimum code necessary to show the functionality, you should use the complete scripts in the build directory.
These scripts are already prepared in the build directory, you simply have to copy to the root the one you want to use.
Do NOT leave these scripts in the root of production systems as anyone can download any module with them!
This is exactly the same as going to the Module Manager and pressing the export button.
File in build/export_package_database.php
<?php // Turn on debugging level $Vtiger_Utils_Log = false; include_once('vtlib/Vtiger/Module.php'); $modulename = vtlib_purify($_REQUEST['modulename']); $module = Vtiger_Module::getInstance($modulename); $pkg = new Vtiger_Package(); $pkg->export($module,'',$modulename.'.zip',true); ?>
File in build/export_package_filesystem.php
<?php // Turn on debugging level $Vtiger_Utils_Log = false; include_once('vtlib/Vtiger/Module.php'); $modulename = vtlib_purify($_REQUEST['modulename']); Vtiger_Package::packageFromFilesystem($modulename,false,true); ?>
File in build/export_language_filesystem.php
<?php // Turn on debugging level $Vtiger_Utils_Log = false; include_once('vtlib/Vtiger/Module.php'); $languagecode = vtlib_purify($_REQUEST['languagecode']); $languagename = vtlib_purify($_REQUEST['languagename']); Vtiger_Package::languageFromFilesystem($languagecode,$languagename,true); ?>
A bundle package is a file which contains 2 or more normal packages to be installed together in a certain order.
In order to construct these packages what we usually do is take all the steps above for each individual package and then manually create the manifest file and zip them all together.
In the build directory you can see how we have set this up for the Project bundle. Since we use links we can call the pack.sh script to get the bundle packaged.