4 +-----------------------------------------------------------------------+
5 | program/include/iniset.php |
7 | This file is part of the RoundCube Webmail client |
8 | Copyright (C) 2008, RoundCube Dev, - Switzerland |
9 | Licensed under the GNU GPL |
12 | Setup the application envoronment required to process |
14 +-----------------------------------------------------------------------+
15 | Author: Till Klampaeckel <till@php.net> |
16 | Thomas Bruederli <roundcube@gmail.com> |
17 +-----------------------------------------------------------------------+
19 $Id: cache.inc 88 2005-12-03 16:54:12Z roundcube $
24 // application constants
25 define('RCMAIL_VERSION', '0.2-stable');
26 define('RCMAIL_CHARSET', 'UTF-8');
27 define('JS_OBJECT_NAME', 'rcmail');
29 if (!defined('INSTALL_PATH')) {
30 define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
33 define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
35 // make sure path_separator is defined
36 if (!defined('PATH_SEPARATOR')) {
37 define('PATH_SEPARATOR', (eregi('win', PHP_OS) ? ';' : ':'));
40 // RC include folders MUST be included FIRST to avoid other
41 // possible not compatible libraries (i.e PEAR) to be included
42 // instead the ones provided by RC
43 $include_path = INSTALL_PATH . PATH_SEPARATOR;
44 $include_path.= INSTALL_PATH . 'program' . PATH_SEPARATOR;
45 $include_path.= INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
46 $include_path.= INSTALL_PATH . 'program/include' . PATH_SEPARATOR;
47 $include_path.= ini_get('include_path');
49 if (set_include_path($include_path) === false) {
50 die('Fatal error: ini_set/set_include_path does not work.');
53 ini_set('session.name', 'roundcube_sessid');
54 ini_set('session.use_cookies', 1);
55 ini_set('session.only_use_cookies', 1);
56 ini_set('session.cookie_secure', ($_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')));
57 ini_set('error_reporting', E_ALL&~E_NOTICE);
58 set_magic_quotes_runtime(0);
60 // increase maximum execution time for php scripts
61 // (does not work in safe mode)
62 if (!ini_get('safe_mode')) {
66 // set internal encoding for mbstring extension
67 if(extension_loaded('mbstring'))
68 mb_internal_encoding(RCMAIL_CHARSET);
72 * Use PHP5 autoload for dynamic class loading
74 * @todo Make Zend, PEAR etc play with this
76 function __autoload($classname)
78 $filename = preg_replace(
89 'lib/html2text' // see #1485505
93 include_once $filename. '.php';
97 * Local callback function for PEAR errors
99 function rcube_pear_error($err)
101 error_log(sprintf("%s (%s): %s",
104 $err->getUserinfo()), 0);
107 // include global functions
108 require_once 'include/bugs.inc';
109 require_once 'include/main.inc';
110 require_once 'include/rcube_shared.inc';
113 // set PEAR error handling (will also load the PEAR main class)
114 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error');