linea21-core
[ class tree: linea21-core ] [ index: linea21-core ] [ all elements ]

Source for file define.php

Documentation is available at define.php

  1. <?php
  2. /**
  3.  * @package linea21.core
  4.  * @subpackage config_files
  5.  * @author linea21 <info@linea21.com>
  6.  * @version $id SVN
  7.  * @access public
  8.  * @license http://opensource.org/licenses/gpl-3.0.html
  9.  */
  10.  
  11. //BE CAREFULL THIS FILE IS A SYSTEM FILE : use config.ini for settings
  12.  
  13. /////////////////////////////////////
  14. //    GLOBALS
  15. /////////////////////////////////////
  16.  
  17. // Defining CURRENT_APP
  18. if(strpos($_SERVER["SCRIPT_FILENAME"]'admin'!== falsedefine('CURRENT_APP''admin');
  19. else define('CURRENT_APP''public');
  20.  
  21. // Defining APPS
  22. // $GLOBALS['APPS'] = array('admin', 'public');
  23.  
  24.  
  25. define('END_LINE',        "\n");
  26. define('TAB_LINE',        "\t");
  27.  
  28. $GLOBALS['current_title'array()// HTML <title> tag
  29.  
  30. $GLOBALS['links'array()// Localized variables
  31. $GLOBALS['filters'array()// Localized (filters) variables
  32.  
  33. $GLOBALS['menuitems'array (
  34.               'home',
  35.                         'news',
  36.               'project',
  37.                           'dashboard',
  38.                         'workgroup',
  39.                           'workgroup-subscription',
  40.                           'publication',
  41.                         'directory',
  42.                         'contribute',
  43.                           'contact'
  44.               );
  45.  
  46.  
  47. // Event Dispatcher Init
  48. include_once("../lib/vendor/sfEventDispatcher/sfEventDispatcher.php");
  49. $dispatcher new sfEventDispatcher();
  50.  
  51. // INI file to PHP Constants
  52. include_once ("../class/class.config_file.php");
  53.  
  54. // if installing app, we use the default define release file
  55. if(isset($installation_process)) {
  56.     $l21config new config_file('config.ini.default');
  57. else {
  58.     $l21config new config_file();
  59. }
  60. $l21config->init();
  61.  
  62. define('CURRENT_APP_URL'SITE_ROOT_URLCURRENT_APP'/');
  63. define('THEME_ADMIN_PATH',        "../".THEME_DIRECTORY."/admin/".THEME_ADMIN."/");
  64. define('THEME_PUBLIC_PATH',        "../".THEME_DIRECTORY."/public/".THEME_PUBLIC."/");
  65.  
  66.  
  67. // Debuger Init
  68. if(defined('MOD_DEBUG'&& MOD_DEBUG == true{
  69.   require_once('../class/system/PHP_Debug/dbg.conf.php');
  70.   require_once('../class/system/PHP_Debug/PHP/Debug.php');
  71.   $Dbg new PHP_Debug($options);
  72.   $renderer 'HTML_Div';
  73.   $Dbg->addSetting($renderer'app_renderer_mode');
  74.   $Dbg->addSettings($options'app_settings');
  75.  
  76.   $Dbg->add('Admin theme : <b>'.THEME_ADMIN.'</b> | Public theme : <b>'.THEME_PUBLIC .'</b>');
  77.   $debug_line $Dbg->add('Pre-execute and includes');
  78. }
  79.  
  80. // Bootstrap (common includes)
  81. include_once("../config/server.php");
  82. include_once("../lib/items.php");
  83. include_once("../lib/lib_common.php");
  84.  
  85. // Culture Init
  86. include_once('../lib/lang.php');
  87. include_once('../class/class.culture.php');
  88. define('U_L'culture::getInstance()->getVar('current'));
  89.  
  90. // Database connexion
  91. include_once("../class/system/class.".SQL.".php");
  92.  
  93. if(isset($Dbg)) {
  94.     $debug_line->setEndTime();
  95.     $debug_line $Dbg->add('... loading SQL files');
  96.     $debug_line->setStartTime();
  97. }
  98.  
  99. // if define.php is called from install script
  100. // we do not instanciate SQL object since the connexion
  101. // is not set yet
  102. if(!isset($installation_process)) {
  103.     $sql_entity=SQL;
  104.     $sql_object new $sql_entity;
  105.     $sql_object -> DBInitialise();
  106.     $sql_object -> DBConnexion();
  107. }
  108.  
  109. // Auth Init - can be overridden by plugin
  110. include_once('../class/class.auth.php');
  111. $l21auth new auth();
  112.  
  113. // Include ONLY the desired language PRODUCTION mode
  114. include(override('../languages/' .U_L'/define.php'));
  115. $GLOBALS['links'array_merge($GLOBALS['links']$l10n_links);
  116. $GLOBALS['filters'array_merge($GLOBALS['filters']$l10n_filters);
  117.  
  118. // if define.php is called from install script
  119. // we do not instanciate plugins
  120. if(!isset($installation_process)) {
  121.     // Plugins Init - installed plugins
  122.     if(defined('MOD_PLUGINS'&& MOD_PLUGINS == 1{
  123.         include_once('../class/class.plugin.php');
  124.         foreach(availablePlugins(as $plugin{
  125.           $plug new plugin($plugin);
  126.           if($plug->is_active()) $plug->loadPlugin();
  127.         }
  128.     }
  129. }
  130.  
  131.  
  132. // finally, we include user configuration file if exists
  133. if(CURRENT_APP == 'admin'{
  134.   $user_conf override('../config/define.php'THEME_ADMIN_PATHfalse);
  135. else {
  136.   $user_conf override('../config/define.php'THEME_PUBLIC_PATHfalse);
  137. }
  138. if(file_exists($user_conf)) include_once($user_conf);
  139. ?>

Documentation generated on Thu, 20 Mar 2014 16:47:17 +0100 by phpDocumentor 1.4.1