-> DEBUG_BT = 1, show mysql/banana/rpc backtrace
-> DEBUG_VALID = 2, validate xhtml
-> DEBUG_SMARTY = 4 = show smarty errors
classes/mmlist.php | 2 +-
classes/platalpage.php | 12 ++++++++----
classes/xdb.php | 6 +++---
include/banana/forum.inc.php | 3 ++-
include/banana/ml.inc.php | 3 ++-
include/banana/moderate.inc.php | 1 +
include/platal.inc.php | 4 ++++
7 files changed, 21 insertions(+), 10 deletions(-)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@1781
839d8a87-29fc-0310-9880-
83ba4fa771e5
$dom = is_null($fqdn) ? $globals->mail->domain : $fqdn;
$url = "http://$uid:$pass@{$globals->lists->rpchost}:{$globals->lists->rpcport}/$dom";
parent::__construct($url);
- if ($globals->debug & 1) {
+ if ($globals->debug & DEBUG_BT) {
$this->bt = new PlBacktrace('MMList');
}
}
switch ($this->_page_type) {
case NO_SKIN:
- error_reporting(0);
+ if (!($globals->debug & DEBUG_SMARTY)) {
+ error_reporting(0);
+ }
$this->display($this->_tpl);
exit;
exit;
}
- if ($globals->debug & 1) {
+ if ($globals->debug & DEBUG_BT) {
PlBacktrace::clean();
$this->assign_by_ref('backtraces', PlBacktrace::$bt);
}
$this->assign('validate', true);
- error_reporting(0);
+ if (!($globals->debug & DEBUG_SMARTY)) {
+ error_reporting(0);
+ }
$result = $this->fetch($skin);
$ttime = sprintf('Temps total: %.02fs - Mémoire totale : %dKo<br />', microtime(true) - $TIME_BEGIN
, memory_get_peak_usage(true) / 1024);
$replc = "<span class='erreur'>VALIDATION HTML INACTIVE</span><br />";
- if ($globals->debug & 2) {
+ if ($globals->debug & DEBUG_VALID) {
$fd = fopen($this->compile_dir."/valid.html","w");
fwrite($fd, $result);
fclose($fd);
{
global $globals;
XDB::$mysqli = new mysqli($globals->dbhost, $globals->dbuser, $globals->dbpwd, $globals->dbdb);
- if ($globals->debug & 1) {
+ if ($globals->debug & DEBUG_BT) {
$bt = new PlBacktrace('MySQL');
if (mysqli_connect_errno()) {
$bt->newEvent("MySQLI connection", 0, mysqli_connect_error());
return false;
}
- if ($globals->debug & 1) {
+ if ($globals->debug & DEBUG_BT) {
$explain = array();
if (strpos($query, 'FOUND_ROWS()') === false) {
$res = XDB::$mysqli->query("EXPLAIN $query");
$res = XDB::$mysqli->query($query);
- if ($globals->debug & 1) {
+ if ($globals->debug & DEBUG_BT) {
PlBacktrace::$bt['MySQL']->stop(@$res->num_rows ? $res->num_rows : XDB::$mysqli->affected_rows,
XDB::$mysqli->error,
$explain);
if (S::has_perms()) {
Banana::$msgshow_mimeparts[] = 'source';
}
- Banana::$debug_nntp = ($globals->debug & 1);
+ Banana::$debug_nntp = ($globals->debug & DEBUG_BT);
+ Banana::$debug_smarty = ($globals->debug & DEBUG_SMARTY);
if (!S::v('core_rss_hash')) {
Banana::$feed_active = false;
}
Banana::$spool_root = $globals->banana->spool_root;
Banana::$spool_boxlist = false;
Banana::$msgedit_canattach = true;
- Banana::$debug_mbox = ($globals->debug & 1);
+ Banana::$debug_mbox = ($globals->debug & DEBUG_BT);
+ Banana::$debug_smarty = ($globals->debug & DEBUG_SMARTY);
Banana::$mbox_helper = $globals->banana->mbox_helper;
if (S::has_perms()) {
Banana::$msgshow_mimeparts[] = 'source';
Banana::$msgshow_externalimages = false;
Banana::$msgshow_mimeparts[] = 'source';
Banana::$feed_active = false;
+ Banana::$debug_smarty = ($globals->debug & DEBUG_SMARTY);
array_push(Banana::$msgparse_headers, 'x-org-id', 'x-org-mail');
parent::__construct($params, 'MLInterface', 'ModerationPage');
}
define('NO_AUTH', 0);
define('DO_AUTH', 1);
+define('DEBUG_BT', 1);
+define('DEBUG_VALID', 2);
+define('DEBUG_SMARTY', 4);
+
function __autoload($cls)
{
$cls = strtolower($cls);