kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file config_defaults_inc.php

Documentation is available at config_defaults_inc.php

  1. <?php
  2. /**
  3.  * @package kernel
  4.  * @subpackage functions
  5.  */
  6.  
  7. /**
  8.  * required setup
  9.  */
  10.  
  11. // when running scripts
  12. global $gShellScript;
  13. if!empty$gShellScript ) ) {
  14.     // keep notices quiet
  15.     $_SERVER['SCRIPT_URL''';
  16.     $_SERVER['HTTP_HOST''localhost';
  17.     $_SERVER['HTTP_USER_AGENT''cron';
  18.     $_SERVER['SERVER_NAME''';
  19.     $_SERVER['HTTP_SERVER_VARS''';
  20.     $_SERVER['REQUEST_URI'= __FILE__;
  21.     $_SERVER['SERVER_ADDR''localhost';
  22.     $_SERVER['REMOTE_ADDR''localhost';
  23.     ifempty$_SERVER['SERVER_ADMIN') ) {
  24.         $_SERVER['SERVER_ADMIN''root@localhost';
  25.     }
  26.  
  27.     // Process some global arguments
  28.     global $gArgs$argv;
  29.     $gArgs array();
  30.     if$argv {
  31.         foreach$argv AS $arg {
  32.             switch$arg {
  33.                 case '--debug':
  34.                     $gDebug TRUE;
  35.                     break;
  36.                 case strpos$arg'--' === 0:
  37.                     ifstrpos$arg'=' ) ) {
  38.                         $gArgs[substr$arg2strpos$arg'=' )-)= (int)substr$arg(strpos$arg'=' +1) );
  39.                     else {
  40.                         $gArgs[substr$arg)TRUE;
  41.                     }
  42.                     break;
  43.             }
  44.         }
  45.     }
  46. }
  47.  
  48. // include the bitweaver configuration file - this needs to happen first
  49. $config_file empty$_SERVER['CONFIG_INC'BIT_ROOT_PATH.'config/kernel/config_inc.php' $_SERVER['CONFIG_INC'];
  50. iffile_exists$config_file ) ) {
  51.     include_once$config_file );
  52. }
  53.  
  54. // =================== Essential Defines ===================
  55. // These defines can be set in config/kernel/config_inc.php. If they haven't been set, we set default values here
  56. // database settings
  57. if!defined'BIT_DB_PREFIX' ) ) {
  58.     define'BIT_DB_PREFIX''' );
  59. }
  60. if!defined'BIT_CACHE_OBJECTS' ) ) {
  61.     define'BIT_CACHE_OBJECTS'TRUE );
  62. }
  63. if!defined'BIT_QUERY_CACHE_TIME' ) ) {
  64.     define'BIT_QUERY_CACHE_TIME'86400 );
  65. }
  66. // default theme after installation
  67. if!defined'DEFAULT_THEME' ) ) {
  68.     define'DEFAULT_THEME''basic' );
  69. }
  70. if!defined'DISPLAY_ERRORS' ) ) {
  71.     define'DISPLAY_ERRORS');
  72. }
  73. // name of session variable in browser cookie
  74. if!defined'BIT_SESSION_NAME' ) ) {
  75.     define'BIT_SESSION_NAME''BWSESSION' );
  76. }
  77. // define where errors are sent
  78. if!defined'BIT_PHP_ERROR_REPORTING' ) ) {
  79.     define'BIT_PHP_ERROR_REPORTING'E_ALL ~E_DEPRECATED ~E_STRICT );
  80. }
  81. // don't change / set _IDs unless you know exactly what you are doing
  82. if!defined'ROOT_USER_ID' ) ) {
  83.     define'ROOT_USER_ID');
  84. }
  85. if!defined'ANONYMOUS_USER_ID' ) ) {
  86.     define'ANONYMOUS_USER_ID'-);
  87. }
  88. if!defined'ANONYMOUS_GROUP_ID' ) ) {
  89.     define'ANONYMOUS_GROUP_ID'-);
  90. }
  91. if!defined'EVIL_EXTENSION_PATTERN' )) {
  92.     define'EVIL_EXTENSION_PATTERN'"#\.(htaccess|pl|php|php3|php4|phtml|py|cgi|asp|jsp|sh|shtml)$#i" );
  93. }
  94.  
  95. // Uncomment to switch to role team model ...
  96. if!defined'ROLE_MODEL' )) {
  97.     define'ROLE_MODEL'true );
  98. }
  99. if!defined'ANONYMOUS_TEAM_ID' ) ) {
  100.     define'ANONYMOUS_TEAM_ID'-);
  101. }
  102.  
  103. // Uncomment the following line if you require attachment and file id's to match the content id
  104. // This is used to simplify content mamagment where fisheye and treasury content is used internally
  105. define'LINKED_ATTACHMENTS'true );
  106.  
  107. // Empty SCRIPT_NAME and incorrect SCRIPT_NAME due to php-cgiwrap - wolff_borg
  108. ifempty$_SERVER['SCRIPT_NAME') ) {
  109.     $_SERVER['SCRIPT_NAME'$_SERVER['SCRIPT_URL'];
  110. }
  111.  
  112. // BIT_ROOT_URL should be set as soon as the system is installed. until then we
  113. // need to make sure we have the correct value, otherwise installations won't
  114. // work. The recent changes have caused problems during installation. i'll try
  115. // combining both methods by applying the less successful one after the more
  116. // successful one - xing
  117. if!defined'BIT_ROOT_URL' ) ) {
  118.     // version one which seems to only cause problems seldomly
  119.     preg_match'/.*'.basenamedirnamedirname__FILE__ ) ) ).'\//'$_SERVER['SCRIPT_NAME']$match );
  120.     $subpath isset($match[0) ) $match[0'/';
  121.     // version two which doesn't work well on it's own
  122.     if$subpath == "/" {
  123.         $subpath dirnamedirname$_SERVER['SCRIPT_NAME') );
  124.         $subpath .= substr$subpath,-1,)!='/' '/' '';
  125.     }
  126.     $subpath str_replace'//''/'str_replace"\\"'/'$subpath ) )// do some de-windows-ification
  127.     define'BIT_ROOT_URL'$subpath );
  128. }
  129.  
  130. // If BIT_ROOT_URI hasn't been set yet, we'll try to get one from the super global $_SERVER.
  131. // This works with apache - not sure about other servers.
  132. if!defined'BIT_BASE_URI' )) {
  133.   // Added check for IIS $_SERVER['HTTPS'] uses 'off' value - wolff_borg
  134.     define'BIT_BASE_URI''http'.((!empty($_SERVER['HTTPS'])&&$_SERVER['HTTPS'!= 'off')?'s':'').'://'.(empty($_SERVER['HTTP_HOST'])?'localhost':$_SERVER['HTTP_HOST']) );
  135. }
  136.  
  137. if!defined'BIT_ROOT_URI' )) {
  138.   // Added check for IIS $_SERVER['HTTPS'] uses 'off' value - wolff_borg
  139.     define'BIT_ROOT_URI'BIT_BASE_URI.BIT_ROOT_URL );
  140. }
  141.  
  142. // custom storage host
  143. if!defined'STORAGE_BASE_URI' ) ) {
  144.     define'STORAGE_BASE_URI'BIT_BASE_URI );
  145. }
  146. // custom storage host
  147. if!defined'STORAGE_HOST_URI' ) ) {
  148.     define'STORAGE_HOST_URI'BIT_ROOT_URI );
  149. }
  150.  
  151. ifsubstr_count$_SERVER['HTTP_HOST']'.' >= {
  152.     define'BIT_BASE_HOST'substr$_SERVER['HTTP_HOST']strpos$_SERVER['HTTP_HOST']'.') );
  153. else {
  154.     define'BIT_BASE_HOST',  $_SERVER['HTTP_HOST');
  155. }
  156.  
  157. // set the currect version of bitweaver
  158. // if this version of bitweaver needs a visit to the installer, update the number in /bit_setup_inc.php
  159. if!defined'BIT_MAJOR_VERSION' ) ) {
  160.     define'BIT_MAJOR_VERSION',    '4' );
  161.     define'BIT_MINOR_VERSION',    '0' );
  162.     define'BIT_SUB_VERSION',        '0' );
  163.     define'BIT_LEVEL',            'lsces' )// dev < alpha < beta < RC# < '' < pl
  164. }
  165.  
  166. // When updating to certain versions of bitweaver, we need to force a visit to the installer to fix certain stuff in the database.
  167. // Enter the minimum version number here in the format: '2.1.0-beta'
  168. if!defined'MIN_BIT_VERSION' ) ) {
  169.     define'MIN_BIT_VERSION''4.0.0' );
  170. }
  171.  
  172. // These defines have to happen FIRST because core classes depend on them.
  173. // This means these packages *CANNOT* be renamed
  174. define'INSTALL_PKG_PATH',   BIT_ROOT_PATH.'install/' );
  175. define'INSTALL_PKG_URL',    BIT_ROOT_URL.'install/' );
  176. define'KERNEL_PKG_DIR',     'kernel' );
  177. define'KERNEL_PKG_NAME',    'kernel' );
  178. define'KERNEL_PKG_PATH',    BIT_ROOT_PATH.'kernel/' );
  179. define'KERNEL_PKG_URL',    BIT_ROOT_URL.KERNEL_PKG_DIR.'/' );
  180. define'CONFIG_PKG_PATH',    BIT_ROOT_PATH.'config/' );
  181. define'LANGUAGES_PKG_PATH'BIT_ROOT_PATH.'languages/' );
  182. define'LIBERTY_PKG_DIR',    'liberty' );
  183. define'LIBERTY_PKG_NAME',   'liberty' );
  184. define'LIBERTY_PKG_PATH',   BIT_ROOT_PATH.'liberty/' );
  185. if!defined'STORAGE_PKG_NAME' ) ) {
  186.     define'STORAGE_PKG_NAME',   'storage' );
  187. }
  188. if!defined'STORAGE_PKG_PATH' ) ) {
  189.     define'STORAGE_PKG_PATH',   BIT_ROOT_PATH.'storage/' );
  190. }
  191. define'THEMES_PKG_PATH',    BIT_ROOT_PATH.'themes/' );
  192. define'USERS_PKG_PATH',     BIT_ROOT_PATH.'users/' );
  193. define'UTIL_PKG_PATH',      BIT_ROOT_PATH.'util/' );
  194. define'EXTERNAL_LIBS_PATH',      BIT_ROOT_PATH.'externals/' );
  195. define'EXTERNAL_LIBS_URL',      BIT_ROOT_URL.'externals/' );
  196.  
  197.  
  198. // =================== Global Variables ===================
  199. // If for any reason this isn't set, nothing will work - nada, zilch...
  200. ifempty$gBitDbHost ) ) {
  201.     $gBitDbHost   'localhost';
  202. }
  203.  
  204. // $gPreScan can be used to specify the order in which packages are scanned by
  205. // the kernel.  In the example provided below, the kernel package is processed
  206. // first, followed by the users and liberty packages.  Any packages not
  207. // specified in $gPreScan are processed in the traditional order
  208. global $gPreScan;
  209. ifempty$gPreScan ) ) {
  210.     $gPreScan array'config''kernel''storage''liberty''themes''users' );
  211. }
  212.  
  213. // here we set the default thumbsizes we use in bitweaver.
  214. // order matters since successively smaller thumbs are used from the preceding thumb for speed increase.
  215. // you can override these by populating this hash in your config/kernel/config_inc.php
  216. global $gThumbSizes;
  217. ifempty$gThumbSizes )) {
  218.     $gThumbSizes array(
  219.         'large'  => array'width' => 1200'height' => 900 ),
  220.         'medium' => array'width' => 800'height' => 600 ),
  221.         'small'  => array'width' => 400'height' => 300 ),
  222.         'avatar' => array'width' => 200'height' => 150 ),
  223.         'icon'   => array'width' => 100,  'height' => 100 ),
  224.     );
  225. }
  226. ?>

Documentation generated on Wed, 29 Jul 2015 13:56:15 +0000 by phpDocumentor 1.5.0-lsces