source: subversion/trunk/roundcubemail/program/include/iniset.php @ 6073

Last change on this file since 6073 was 6073, checked in by alec, 13 months ago
  • Merge devel-framework branch, resolved conflicts
  • Property svn:keywords set to Id
File size: 3.3 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/include/iniset.php                                            |
6 |                                                                       |
7 | This file is part of the Roundcube Webmail client                     |
8 | Copyright (C) 2008-2012, The Roundcube Dev Team                       |
9 |                                                                       |
10 | Licensed under the GNU General Public License version 3 or            |
11 | any later version with exceptions for skins & plugins.                |
12 | See the README file for a full license statement.                     |
13 |                                                                       |
14 | PURPOSE:                                                              |
15 |   Setup the application envoronment required to process               |
16 |   any request.                                                        |
17 +-----------------------------------------------------------------------+
18 | Author: Till Klampaeckel <till@php.net>                               |
19 |         Thomas Bruederli <roundcube@gmail.com>                        |
20 +-----------------------------------------------------------------------+
21
22 $Id$
23
24*/
25
26// Some users are not using Installer, so we'll check some
27// critical PHP settings here. Only these, which doesn't provide
28// an error/warning in the logs later. See (#1486307).
29$crit_opts = array(
30    'mbstring.func_overload' => 0,
31    'suhosin.session.encrypt' => 0,
32    'session.auto_start' => 0,
33    'file_uploads' => 1,
34    'magic_quotes_runtime' => 0,
35);
36foreach ($crit_opts as $optname => $optval) {
37    if ($optval != ini_get($optname)) {
38        die("ERROR: Wrong '$optname' option value. Read REQUIREMENTS section in INSTALL file or use Roundcube Installer, please!");
39    }
40}
41
42// application constants
43define('RCMAIL_VERSION', '0.9-svn');
44define('RCMAIL_CHARSET', 'UTF-8');
45define('JS_OBJECT_NAME', 'rcmail');
46define('RCMAIL_START', microtime(true));
47
48if (!defined('INSTALL_PATH')) {
49    define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
50}
51
52if (!defined('RCMAIL_CONFIG_DIR')) {
53    define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
54}
55
56// RC include folders MUST be included FIRST to avoid other
57// possible not compatible libraries (i.e PEAR) to be included
58// instead the ones provided by RC
59$include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
60$include_path.= ini_get('include_path');
61
62if (set_include_path($include_path) === false) {
63    die("Fatal error: ini_set/set_include_path does not work.");
64}
65
66ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
67
68// increase maximum execution time for php scripts
69// (does not work in safe mode)
70@set_time_limit(120);
71
72// set internal encoding for mbstring extension
73if (extension_loaded('mbstring')) {
74    mb_internal_encoding(RCMAIL_CHARSET);
75    @mb_regex_encoding(RCMAIL_CHARSET);
76}
77
78// include global functions
79require_once INSTALL_PATH . 'program/include/rcube_shared.inc';
80
81// Register autoloader
82spl_autoload_register('rcube_autoload');
83
84// set PEAR error handling (will also load the PEAR main class)
85PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error');
86
87// backward compatybility (to be removed)
88require_once INSTALL_PATH . 'program/include/main.inc';
Note: See TracBrowser for help on using the repository browser.