Knickers Configuration Files
The following explains how configs work in Knickers.
Generally, there are 4 types of config files:
- cfg - Contains constants necessary for the functioning of code. These are not settings to be overridden.
- arrays - Contains arrays of params, template files, alternate file names, etc to be accessed through cfg. May use constants
defined in cfg. Arrays can be as follows:
- $this->params: Config parameters, indexed by name (accessed with getParam('name'))
- $this->miscArrays: Misc arrays of information, indexed by array type (constant) then by name (accessed with getMiscArray(type))
- $this->tplVars: Template vars to auto-set into OG. Indexed by tag. Also accessed by getTemplateVar($tag);
- $this->params: Config parameters, indexed by name (accessed with getParam('name'))
- consts - Contains settings constants that you may want to override with customizations.
- conn - Storage connection information, stored in an array indexed by storage type
Files
Below is an explanation of the many different files you may use in conjunction with Knickers:
- knickers.cfg.php - The Knickers-level config file. You probably don't want to mess with this aside from perhaps a URL for testapp
- knickers_app.cfg.php - Put this in your app/cfg dir and make sure it knows how to find knickers.cfg.php. This is where you
can configure Knickers-related settings for your app (but probably not where you want to put app-related
settings). Be sure to define KNICKERS_APP_ID as it is used to find your app-level config files. Also
set KNICKERS_USE_SUBSYSTEM to TRUE if you are going to use subsystems that override your systems.
- [KNICKERS_APP_ID].cfg.php - This is where app-level constants necessary for the functioning of your app (but not to be overridden
by customizations) go.
- [KNICKERS_APP_ID].arrays.php - This is where app-level array information goes. These may be overridden by system/subsystem settings.
- [KNICKERS_APP_ID].consts.php - This is where app-level settings constants go. These may be overridden by system/subsystem settings.
- [KNICKERS_APP_ID].conn.php - This is where app-level connection/storage settings go. These may be overridden by system/subsystem settings.
- [system_name].cfg.php - This is where system-level constants necessary for the functioning of your app (but not to be overridden
by customizations) go.
- [system_name].arrays.php - This is where system-level array information goes. These may be overridden by subsystem settings.
- [system_name].consts.php - This is where system-level settings constants go. These may be overridden by subsystem settings.
- [system_name].conn.php - This is where system-level connection/storage settings go. These may be overridden by subsystem settings.
- [system_name]_[subsystem_name].cfg.php - This is where subsystem-level constants necessary for the functioning of your app (but not to be overridden
by customizations) go.
- [system_name]_[subsystem_name].arrays.php - This is where subsystem-level array information goes.
- [system_name]_[subsystem_name].consts.php - This is where subsystem-level settings constants go.
- [system_name]_[subsystem_name].conn.php - This is where subsystem-level connection/storage settings go.
- Thing.cfg.php - Maps useful Thing names to their associated class names. Also configures some Thing setup options.
- frills.cfg.php - Contains information about activated frills and the files they contain.
Standard Misc Arrays
Below are the miscarrays that Knickers supports:
- MISC_ARRAY_ALT_PAGE_NAMES - Alternate page/panel class names. Indexed by what you will use in the URL to access that page/panel. Most often
used for desired differences in capitalization.
$this->miscArrays[MISC_ARRAY_ALT_PAGE_NAMES]['PreProcess_TestAlt'] = 'PreProcess_Test';
- MISC_ARRAY_AVAILABLE_TRANSLATIONS - What translated languages you have available (for the unfinished "Click to Translate")
$this->miscArrays[MISC_ARRAY_AVAILABLE_TRANSLATIONS]['fr_FR'] = 'French';
- MISC_ARRAY_ALT_CLASS_NAMES - Generic alternate class names. Indexed by what you will use to look up the class. Used for CRUD.
$this->miscArrays[MISC_ARRAY_ALT_CLASS_NAMES]['Panel_user'] = 'Panel_VEC';
- MISC_ARRAY_ADDITIONAL_STORAGE_FILES - Additional storage files to load into your app by default. Indexed by some label for the storage.
$this->miscArrays[MISC_ARRAY_ADDITIONAL_STORAGE_FILES]['storage_db_add'] = 'test_add.conn.php';