]> git.donarmstrong.com Git - roundcube.git/blob - installer/utils.php
Merge commit 'debian/0.2_stable-1' into debian
[roundcube.git] / installer / utils.php
1 <?php
2
3
4 /**
5  * Use PHP5 autoload for dynamic class loading
6  * (copy from program/incllude/iniset.php)
7  */
8 function __autoload($classname)
9 {
10   $filename = preg_replace(
11       array('/MDB2_(.+)/', '/Mail_(.+)/', '/^html_.+/', '/^utf8$/'),
12       array('MDB2/\\1', 'Mail/\\1', 'html', 'utf8.class'),
13       $classname
14   );
15   include_once $filename. '.php';
16 }
17
18
19 /**
20  * Shortcut function for htmlentities()
21  *
22  * @param string String to quote
23  * @return string The html-encoded string
24  */
25 function Q($string)
26 {
27   return htmlentities($string, ENT_COMPAT, 'UTF-8');
28 }
29
30
31 /**
32  * Fake rinternal error handler to catch errors
33  */
34 function raise_error($p)
35 {
36   $rci = rcube_install::get_instance();
37   $rci->raise_error($p);
38 }
39
40