Aleksander Machniak
2012-08-08 de56ea1909d515d3e4807a04a6c4644b8226d08d
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             '/Mail_(.+)/',
27             '/Net_(.+)/',
28             '/Auth_(.+)/',
29             '/^html_.+/',
30             '/^utf8$/'
31         ),
32         array(
33             'Mail/\\1',
34             'Net/\\1',
35             'Auth/\\1',
36             'html',
37             'utf8.class'
38         ),
39         $classname
40     );
41     include_once $filename. '.php';
fee8c6 42 }
T 43
434869 44 /**
T 45  * Local callback function for PEAR errors
46  */
0c2596 47 function __pear_error($err)
434869 48 {
0c2596 49     rcmail::raise_error(array(
434869 50         'code' => $err->getCode(),
T 51         'message' => $err->getMessage(),
52     ));
53 }
54
55 // set PEAR error handling (will also load the PEAR main class)
0c2596 56 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, '__pear_error');