InterJinn

Development Framework For PHP

Core Variables Configuration

If you have installed the InterJinn framework then you will find a template configuration file located in /INTERJINN/Projects/ called templateConfig.inc. You can use this template configuration file to help you get started quickly.

The purpose of this configuration file is to set up any configuration directives and variables that will control how your installation of interJinn will work. Generally speaking any configuration can be done here, whether it is related to InterJinn or not. For instance I like to set the error level and umask for my project at the top of this file:

Example:
//
// Error handling settings.
//
ini_set( 'display_errors',       1 );
ini_set( 'log_errors',           1 );
ini_set( 'error_reporting',     -1 );
umask( 0002 );
By setting these values here I can easily control the configuration on a project by project basis, rather than assuming a global configuration via php.ini or setting in the web server configuration file (i.e. httpd.conf).

The following variables are important for template development with InterJinn. These values provide some important information to the framework about where to find certain files both on the filesystem and on the Internet.

$GLOBALS['interJinn']['configPath']

This variable is used by InterJinn to find the current project's configuration file. More than likely you can leave this value set to __FILE__. You can however, set it to another value. At the time of this writing changing this value to an arbitrary path will have the affect of changing the included file set when using the <jinn:prepend/> tag with the TemplateJinn system.

Example:
$GLOBALS['interJinn']['configPath'] = __FILE__;

$GLOBALS['interJinn']['coreRoot']

Set this to the root directory of the InterJinn installation to be used for this project. This configuration variable makes it convenient to have multiple InterJinn installations.

Example:
$GLOBALS['interJinn']['coreRoot'] = '/var/www/apps/interJinn/';

$GLOBALS['interJinn']['codeRoot']

This configuration value should be set to the root directory of your project. This is used when determining the location of content or code which has been defined relative to your project.

Example:
$GLOBALS['interJinn']['codeRoot'] = '/var/www/projects/myProject/';

$GLOBALS['interJinn']['pageRoot']

Set this to let InterJinn know where to find the root of your content files on the filesystem. InterJinn will need this specifically when compiling content pages via TemplateJinn and when checking dependencies to determine if the file needs recompilation.

Example:
$GLOBALS['interJinn']['pageRoot'] = '/var/www/apps/interJinn/';

$GLOBALS['interJinn']['pageBase']

This will let InterJinn know where from the pageRoot it can find the actual content files. It also informs InterJinn about the structure of your Web site. Setting this to anything other than / means that InterJinn will always consider content to exist in this subdirectory for both the Web site and the filesystem. All references to the link/url or image property types will be based from this subdirectory. This is a convenient way to provide a shorthand for sub-sites located within a common subdirectory.

Example:
$GLOBALS['interJinn']['pageRoot'] = '/admin/';

$GLOBALS['interJinn']['imagebase']

It is useful and convenient to store all of the images for a Web site in a common location. While a single directory is not very interesting, a directory tree rooted from one common image directory, provides a quick way to find any image used by your Web site. This value informs InterJinn of where that directory is located. Thus for any image retrievals the actual location of the image will be considered to be a subpath of the imageBase directory. For the file system it will be the concatenation of the pageRoot and imageBase

Example:
$GLOBALS['interJinn']['pageRoot'] = '/admin/images/';

$GLOBALS['interJinn']['pageCompression']

This can be set to either true or false. When set to true PHP will compress your Web content before sending it along to your Web server. This is just a convenient setting to enable compression. Note that you will want to disable this if your Web server is already performing compression or if you have set zlib.output_compression in your php.ini file.

Example:
$GLOBALS['interJinn']['pageCompression'] = true;

$GLOBALS['interJinn']['multilingual']

Set this to true if you want to activate multilingualism for your programs or Web content. This is an extremely powerful setting. When set it influences how properties are loaded and how TemplateJinn handles patterns and paths. There is no harm in enabling this even if you are not running anything multilingual, as long as you understand its effects (see the Multilingualism Documentation for more information).

Example:
$GLOBALS['interJinn']['multilingual'] = true;

$GLOBALS['interJinn']['defaultLanguage']

If you have configured your project to be multilingual then set this value to declare a default language. This will be the language used when no other has been defined or detected.

Example:
$GLOBALS['interJinn']['defaultLanguage'] = 'en';