summaryrefslogtreecommitdiff
blob: 4231e21c7975fd983ce586fe9493b5c1efecb162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
function debug ($type, $text=null) {
	global $conf, $S;
	if ($conf['debug']) {
		if ($text===null) {
			$text=$type;
			$type=null;
		}
		if (defined('STDERR')) { // This is backend, probably
			fputs(STDERR, (isset($type)?$type.': ':'').$text."\n");
		} else { // This is probably frontend
			$S['debug'][]=array($type, $text);
		}
	}
}
?>