install.php

Installer

The installer file is run on module install or upgrade.

 

 

Some simple tips and hints are listed below:

Database Calls

All database calls are done through the global variable $db which is a pearDB object. Simpler calls can be done through the function sql().

Screen Output Calls

There are two types of screen output calls that you cab use during install to display text to your users.

function out('')

When this function is used it will echo any output within and also return an HTML break or newline afterwards. Please remember to use localization strings (gettext, eg _('string')) when you output text

out(_("Installing My Cool Module!")); out(_("Installing Next Part of My Cool Module!"));

The above code will output

Installing My Cool Module! Installing Next Part of My Cool Module!

function outn('')

When this function is used it will echo any output within and however it will NOT echo out an HTML break or a newline. Please remember to use localization strings (gettext, eg _('string')) when you output text

outn(_("Upgrading Table..")); //Upgrade Code out(_("Done!"));

The above code will output

Adding and Removing Advanced Settings Items

Using the freepbx_conf class you can add and remove advanced settings items from install.php. Please see Advanced Settings Class for more information

Adding and Removing Feature Codes

Using the Feature Code Admin class you can add and feature codes from install.php. Please see Feature Code Admin Class for more information

Return to Documentation Home I Return to Sangoma Support