alecpl
2012-04-23 7c722504c6f36997ba3e13cd55c079254dd8fb54
commit | author | age
fee8c6 1 <?php
df3c35 2 /*
T 3  +-------------------------------------------------------------------------+
7fe381 4  | Roundcube Webmail installer utilities                                   |
df3c35 5  |                                                                         |
434869 6  | Copyright (C) 2005-2011, The Roundcube Dev Team                         |
df3c35 7  |                                                                         |
7fe381 8  | Licensed under the GNU General Public License version 3 or              |
T 9  | any later version with exceptions for skins & plugins.                  |
10  | See the README file for a full license statement.                       |
df3c35 11  |                                                                         |
T 12  +-------------------------------------------------------------------------+
13  | Author: Thomas Bruederli <roundcube@gmail.com>                          |
14  +-------------------------------------------------------------------------+
fee8c6 15
df3c35 16  $Id: index.php 2696 2009-07-02 06:38:26Z thomasb $
T 17
18 */
fee8c6 19
T 20 /**
21  * Use PHP5 autoload for dynamic class loading
2c3d81 22  * (copy from program/include/iniset.php)
fee8c6 23  */
T 24 function __autoload($classname)
25 {
7479c1 26     $filename = preg_replace(
A 27         array(
28             '/MDB2_(.+)/',
29             '/Mail_(.+)/',
30             '/Net_(.+)/',
31             '/Auth_(.+)/',
32             '/^html_.+/',
33             '/^utf8$/'
34         ),
35         array(
36             'MDB2/\\1',
37             'Mail/\\1',
38             'Net/\\1',
39             'Auth/\\1',
40             'html',
41             'utf8.class'
42         ),
43         $classname
44     );
45     include_once $filename. '.php';
fee8c6 46 }
T 47
434869 48 /**
T 49  * Local callback function for PEAR errors
50  */
0c2596 51 function __pear_error($err)
434869 52 {
0c2596 53     rcmail::raise_error(array(
434869 54         'code' => $err->getCode(),
T 55         'message' => $err->getMessage(),
56     ));
57 }
58
59 // set PEAR error handling (will also load the PEAR main class)
0c2596 60 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, '__pear_error');