Solutions  | Services  | Support  | Search

PlumJelly config files

Config files are used by PlumJelly libraries, modules and applications. These files share a common format, naming convention and set of valid locations. Config files that have the wrong name and/or are stored in the wrong location will be ignored.

Config file names

A config file must be named to match the library, module or application it is associated with.

Library lib_<lib_name>.php is configured by the file config_<lib_name>.php

Module <mod_name> is configured by the file config_<mod_name>.php

Application <app_name> is configured by the file config_<app_name>.php

Note that, just as a config file can be associated with a library, a library is, in turn, always associated with either a module or an application. The main or only library for a module or application usually shares it’s name with that module or application. In this situation the library and the module or application also share a config file.

For example, the PlumJelly application called Folio (app name folio) has a library called lib_folio.php; the single file config_folio.php is used to configure both the folio application and the folio library. This actually simplifies things! It would otherwise be a rather arbitrary decision whether a given setting should go in the module or application config file or, instead, in the config file for the library that provides the main functionality to that module or application.

Config file format

Module and library configuration files are PHP files that use the following internal format to store none, one or more name/value pairs.

<?php 
$config['<name>']='<value>';
$config['<name>']='<value>';
$config['<name>']='<value>';
?>

The config file may also contain any valid PHP comments but should not contain any other PHP code.

Reading config files

You do not need to explicitly read a config file; they are read automatically by the PlumJelly framework at the appropriate time.

Library config files are read when the corresponding library is loaded.
Module config files are read when the corresponding module is loaded.
Application config files are read when the corresponding application is loaded.

Config file locations

The PlumJelly framework looks for a given config file in a specific set of folders and searches those folders in a specific order.

The search does not stop with the first file to be found; all files found will be read and values found in later files will overwrite values for the same name in earlier files. A config file in any given location may be empty or missing; no error will be issued.

Config files are searched for in the following folders in the order they are listed below (in these examples <name> represents the library, module or application name as appropriate):

A. The module or application library folder

plumjelly/modules/<module_name>/library/config_<name>.php
or
plumjelly/apps/<app_name>/library/config_<app_name>.php

This location sets system defaults and ensures all config settings have a valid initial value. It would be unusual to edit these settings after installation of the PlumJelly framework.

B. The module or application config folder

plumjelly/modules/<module_name>/config/config_<name>.php
or
plumjelly/apps/<app_name>/config/config_<app_name>.php

This location sets any Installation defaults, the default production values for this server that apply to all organisations installed on this server.

C. The module or application custom folder

plumjelly/modules/<module_name>/custom/config_<name>.php
or
plumjelly/apps/<app_name>/custom/config_<lib_name>.php

This location sets any values used during development, testing and troubleshooting. Using this location means production values do not need to be edited or deleted. At the end of testing the values can be transferred to the module or application config folder (B above) and the config file in this folder can then be deleted or renamed.

D. The organisation config folder

plumjelly/orgs/<org_id>/config/config_<lname>.php

This location sets any organisation defaults. The values for one organisation installed on this server, where they differ for those for other organisations, are stored in this location.

E. The organisation custom folder

plumjelly/orgs/<org_id>/custom/config_<name>.php

This location sets any values used during development, testing and troubleshooting of organisation templates or other organisation specific scripts. Using this location means production values do not need to be edited or deleted. At the end of testing the values can be transferred to the organisation config folder (D above) and this config file can then be deleted or renamed.

F. User or session defaults.

This is not a folder location. At runtime user specific settings can added to the library, module or application configuration to personalise the configuration settings. This is done automatically by the PlumJelly framework.

Editing config files

Software developers and the server administrator may need to edit any of these files but organisation administrators would normally only have rights to edit their own organisation config files (D and E above).

Home  | Contact  | Payment  | Terms  | Login

Copyright Synergy Data Services Ltd. © 2012-2026. Registered in England and Wales. Company No. 8318571 x