From 0e7f04ab991d029fc9c1c8e5faac76b6284d38fc Mon Sep 17 00:00:00 2001 From: rurban Date: Thu, 11 Nov 2004 18:31:26 +0000 Subject: [PATCH] add simple backtrace on such general failures to get at least an idea where git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@4128 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/Theme.php | 16 +++++++++++++++- lib/WikiDB.php | 18 ++++++++++++++++-- lib/stdlib.php | 17 ++++++++++++++++- 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/lib/Theme.php b/lib/Theme.php index b422dd1a0..c62d2c891 100644 --- a/lib/Theme.php +++ b/lib/Theme.php @@ -1,4 +1,4 @@ -_default_theme->_findFile($file, $missing_okay); } else if (!$missing_okay) { + if (DEBUG & function_exists('debug_backtrace')) { // >= 4.3.0 + echo "
", printSimpleTrace(debug_backtrace()), "
\n"; + } trigger_error("$file: not found", E_USER_NOTICE); } return false; @@ -1376,6 +1379,17 @@ function listAvailableLanguages() { } // $Log: not supported by cvs2svn $ +// Revision 1.113 2004/11/09 17:11:04 rurban +// * revert to the wikidb ref passing. there's no memory abuse there. +// * use new wikidb->_cache->_id_cache[] instead of wikidb->_iwpcache, to effectively +// store page ids with getPageLinks (GleanDescription) of all existing pages, which +// are also needed at the rendering for linkExistingWikiWord(). +// pass options to pageiterator. +// use this cache also for _get_pageid() +// This saves about 8 SELECT count per page (num all pagelinks). +// * fix passing of all page fields to the pageiterator. +// * fix overlarge session data which got broken with the latest ACCESS_LOG_SQL changes +// // Revision 1.112 2004/11/03 16:50:31 rurban // some new defaults and constants, renamed USE_DOUBLECLICKEDIT to ENABLE_DOUBLECLICKEDIT // diff --git a/lib/WikiDB.php b/lib/WikiDB.php index a6ba0fb5f..dfd86540b 100644 --- a/lib/WikiDB.php +++ b/lib/WikiDB.php @@ -1,5 +1,5 @@ = 4.3.0 + echo "
", printSimpleTrace(debug_backtrace()), "
\n"; + } trigger_error("no SQL database", E_USER_ERROR); return false; } @@ -563,6 +566,9 @@ class WikiDB { // SQL iter: for simple select or create/update queries // returns the generic iterator object (count,next) function genericSqlIter($sql, $field_list = NULL) { + if (function_exists('debug_backtrace')) { // >= 4.3.0 + echo "
", printSimpleTrace(debug_backtrace()), "
\n"; + } trigger_error("no SQL database", E_USER_ERROR); return false; } @@ -576,7 +582,8 @@ class WikiDB { function isOpen () { global $request; if (!$request->_dbi) return false; - else return true; + else return false; /* so far only needed for sql so false it. + later we have to check dba also */ } function getParam($param) { @@ -2030,6 +2037,13 @@ function _sql_debuglog_shutdown_function() { } // $Log: not supported by cvs2svn $ +// Revision 1.101 2004/11/10 19:32:22 rurban +// * optimize increaseHitCount, esp. for mysql. +// * prepend dirs to the include_path (phpwiki_dir for faster searches) +// * Pear_DB version logic (awful but needed) +// * fix broken ADODB quote +// * _extract_page_data simplification +// // Revision 1.100 2004/11/10 15:29:20 rurban // * requires newer Pear_DB (as the internal one): quote() uses now escapeSimple for strings // * ACCESS_LOG_SQL: fix cause request not yet initialized diff --git a/lib/stdlib.php b/lib/stdlib.php index 5c3a493ee..6d8ef0250 100644 --- a/lib/stdlib.php +++ b/lib/stdlib.php @@ -1,4 +1,4 @@ - $elem) { + if (!array_key_exists('file', $elem)) { + continue; + } + echo join(" ",array_values($elem)),"\n"; + //print " " . $elem['file'] . ':' . $elem['line'] . " " .$elem['function']"\n"; + } +} + // $Log: not supported by cvs2svn $ +// Revision 1.215 2004/11/11 14:34:12 rurban +// minor clarifications +// // Revision 1.214 2004/11/11 11:01:20 rurban // fix loadPhpExtension // -- 2.45.0