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