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

Last change on this file was 6091, checked in by alec, 14 months ago
  • Framework refactoring (I hope it's the last one): rcube,rcmail,rcube_ui -> rcube,rcmail,rcube_utils renamed main.inc into rcube_bc.inc
  • 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('RCMAIL_START', microtime(true));
46
47if (!defined('INSTALL_PATH')) {
48    define('INSTALL_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
49}
50
51if (!defined('RCMAIL_CONFIG_DIR')) {
52    define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config');
53}
54
55// RC include folders MUST be included FIRST to avoid other
56// possible not compatible libraries (i.e PEAR) to be included
57// instead the ones provided by RC
58$include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR;
59$include_path.= ini_get('include_path');
60
61if (set_include_path($include_path) === false) {
62    die("Fatal error: ini_set/set_include_path does not work.");
63}
64
65ini_set('error_reporting', E_ALL &~ (E_NOTICE | E_STRICT));
66
67// increase maximum execution time for php scripts
68// (does not work in safe mode)
69@set_time_limit(120);
70
71// set internal encoding for mbstring extension
72if (extension_loaded('mbstring')) {
73    mb_internal_encoding(RCMAIL_CHARSET);
74    @mb_regex_encoding(RCMAIL_CHARSET);
75}
76
77// include global functions
78require_once INSTALL_PATH . 'program/include/rcube_shared.inc';
79
80// Register autoloader
81spl_autoload_register('rcube_autoload');
82
83// set PEAR error handling (will also load the PEAR main class)
84PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'rcube_pear_error');
85
86// backward compatybility (to be removed)
87require_once INSTALL_PATH . 'program/include/rcube_bc.inc';
Note: See TracBrowser for help on using the repository browser.