Source for file define.php
Documentation is available at define.php
* @subpackage config_files
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//BE CAREFULL THIS FILE IS A SYSTEM FILE : use config.ini for settings
/////////////////////////////////////
/////////////////////////////////////
if(strpos($_SERVER["SCRIPT_FILENAME"], 'admin') !== false) define('CURRENT_APP', 'admin');
else define('CURRENT_APP', 'public');
// $GLOBALS['APPS'] = array('admin', 'public');
$GLOBALS['current_title'] = array(); // HTML <title> tag
$GLOBALS['links'] = array(); // Localized variables
$GLOBALS['filters'] = array(); // Localized (filters) variables
$GLOBALS['menuitems'] = array (
'workgroup-subscription',
include_once("../lib/vendor/sfEventDispatcher/sfEventDispatcher.php");
$dispatcher = new sfEventDispatcher();
// INI file to PHP Constants
include_once ("../class/class.config_file.php");
// if installing app, we use the default define release file
if(isset ($installation_process)) {
define('CURRENT_APP_URL', SITE_ROOT_URL. CURRENT_APP. '/');
define('THEME_ADMIN_PATH', "../". THEME_DIRECTORY. "/admin/". THEME_ADMIN. "/");
define('THEME_PUBLIC_PATH', "../". THEME_DIRECTORY. "/public/". THEME_PUBLIC. "/");
if(defined('MOD_DEBUG') && MOD_DEBUG == true) {
require_once('../class/system/PHP_Debug/dbg.conf.php');
require_once('../class/system/PHP_Debug/PHP/Debug.php');
$Dbg = new PHP_Debug($options);
$Dbg->addSetting($renderer, 'app_renderer_mode');
$Dbg->addSettings($options, 'app_settings');
$Dbg->add('Admin theme : <b>'. THEME_ADMIN. '</b> | Public theme : <b>'. THEME_PUBLIC . '</b>');
$debug_line = $Dbg->add('Pre-execute and includes');
// Bootstrap (common includes)
include_once("../config/server.php");
include_once("../lib/items.php");
include_once("../lib/lib_common.php");
include_once('../lib/lang.php');
include_once('../class/class.culture.php');
define('U_L', culture::getInstance()->getVar('current'));
include_once("../class/system/class.". SQL. ".php");
$debug_line->setEndTime();
$debug_line = $Dbg->add('... loading SQL files');
$debug_line->setStartTime();
// if define.php is called from install script
// we do not instanciate SQL object since the connexion
if(!isset ($installation_process)) {
$sql_object = new $sql_entity;
$sql_object -> DBInitialise();
$sql_object -> DBConnexion();
// Auth Init - can be overridden by plugin
include_once('../class/class.auth.php');
// Include ONLY the desired language PRODUCTION mode
include(override('../languages/' . U_L. '/define.php'));
$GLOBALS['links'] = array_merge($GLOBALS['links'], $l10n_links);
$GLOBALS['filters'] = array_merge($GLOBALS['filters'], $l10n_filters);
// if define.php is called from install script
// we do not instanciate plugins
if(!isset ($installation_process)) {
// Plugins Init - installed plugins
if(defined('MOD_PLUGINS') && MOD_PLUGINS == 1) {
include_once('../class/class.plugin.php');
if($plug->is_active()) $plug->loadPlugin();
// finally, we include user configuration file if exists
|