cvs: phd(PHD_ENTERPRISE) / config.php mktoc.php render.php /formats bigxhtml.php php.php xhtml.php /include PhDBuildOptions.class.php
PhDConfig.class.php PhDErrors.php PhDPartialReader.class.php PhDTheme.class.php
| From: | Rudy Nappée | Date: | Fri, 01 Aug 2008 11:02:04 +0000 |
| Subject: | cvs: phd(PHD_ENTERPRISE) / config.php mktoc.php render.php /formats bigxhtml.php php.php xhtml.php /include PhDBuildOptions.class.php PhDConfig.class.php PhDErrors.php PhDPartialReader.class.php PhDTheme.class.php |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-1968@lists.php.net to get a copy of this message | ||
loudi Fri Aug 1 11:02:04 2008 UTC
Removed files: (Branch: PHD_ENTERPRISE)
/phd mktoc.php
/phd/include PhDTheme.class.php PhDConfig.class.php
PhDPartialReader.class.php
Modified files:
/phd config.php render.php
/phd/formats xhtml.php php.php bigxhtml.php
/phd/include PhDBuildOptions.class.php PhDErrors.php
Log:
* removed no longer necessary files
* added name of format processed
* added color and version stuff from RESTRUCTURE branch
http://cvs.php.net/viewvc.cgi/phd/config.php?r1=1.53.2.2&r2=1.53.2.3&diff_format=u Index: phd/config.php diff -u phd/config.php:1.53.2.2 phd/config.php:1.53.2.3 --- phd/config.php:1.53.2.2 Wed Jul 30 12:17:20 2008 +++ phd/config.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: config.php,v 1.53.2.2 2008/07/30 12:17:20 loudi Exp $ */ +/* $Id: config.php,v 1.53.2.3 2008/08/01 11:02:03 loudi Exp $ */ require $ROOT . "/include/PhDErrors.php"; @@ -30,6 +30,7 @@ ), 'color_output' => false, 'output_dir' => './', + 'intermediate_output_dir' => '.', 'php_error_output' => NULL, 'php_error_color' => false, 'user_error_output' => NULL, http://cvs.php.net/viewvc.cgi/phd/render.php?r1=1.3.2.6&r2=1.3.2.7&diff_format=u Index: phd/render.php diff -u phd/render.php:1.3.2.6 phd/render.php:1.3.2.7 --- phd/render.php:1.3.2.6 Thu Jul 31 21:23:19 2008 +++ phd/render.php Fri Aug 1 11:02:03 2008 @@ -20,6 +20,11 @@ //$INDEX = $FILENAME = "/home/bjori/php/cleandocs/json.xml"; define("NO_SQLITE", false); +/* If no docbook file was passed, die */ +if (!is_dir(PhDConfig::xml_root()) || !is_file(PhDConfig::xml_file())) { + trigger_error("No '.manual.xml' file was given. Specify it on the command line with --docbook.", E_USER_ERROR); +} + PhDConfig::init(array( "verbose" => VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING), "lang_dir" => $ROOT . DIRECTORY_SEPARATOR . "include" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR, http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.68.2.4&r2=1.68.2.5&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.68.2.4 phd/formats/xhtml.php:1.68.2.5 --- phd/formats/xhtml.php:1.68.2.4 Thu Jul 31 21:23:19 2008 +++ phd/formats/xhtml.php Fri Aug 1 11:02:03 2008 @@ -1,6 +1,7 @@ <?php -/* $Id: xhtml.php,v 1.68.2.4 2008/07/31 21:23:19 loudi Exp $ */ +/* $Id: xhtml.php,v 1.68.2.5 2008/08/01 11:02:03 loudi Exp $ */ class PhDXHTMLFormat extends PhDFormat { + private $simpleName = "XHTML"; private $myelementmap = array( /* {{{ */ 'abstract' => 'div', /* Docbook-xsl prints "abstract"... */ 'abbrev' => 'abbr', @@ -594,6 +595,10 @@ $this->registerTextMap(static::getDefaultTextMap()); } break; + + case PhDRender::INIT: + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); + break; } } http://cvs.php.net/viewvc.cgi/phd/formats/php.php?r1=1.4.2.4&r2=1.4.2.5&diff_format=u Index: phd/formats/php.php diff -u phd/formats/php.php:1.4.2.4 phd/formats/php.php:1.4.2.5 --- phd/formats/php.php:1.4.2.4 Wed Jul 30 12:17:21 2008 +++ phd/formats/php.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,6 @@ <?php class PhDPHPFormat extends PhDXHTMLFormat { + private $simpleName = "PHP"; private $myelementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', @@ -132,6 +133,10 @@ $this->registerTextMap(static::getDefaultTextMap()); } break; + + case PhDRender::INIT: + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); + break; } } public function format_suppressed_text($value, $tag) { http://cvs.php.net/viewvc.cgi/phd/formats/bigxhtml.php?r1=1.2.2.4&r2=1.2.2.5&diff_format=u Index: phd/formats/bigxhtml.php diff -u phd/formats/bigxhtml.php:1.2.2.4 phd/formats/bigxhtml.php:1.2.2.5 --- phd/formats/bigxhtml.php:1.2.2.4 Wed Jul 30 12:17:21 2008 +++ phd/formats/bigxhtml.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,6 @@ <?php class PhDBigXHTMLFormat extends PhDXHTMLFormat { + private $simpleName = "Big-XHTML"; private $myelementmap = array( 'link' => 'format_link', 'xref' => 'format_xref', @@ -112,6 +113,7 @@ } else { $this->close(); } + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); break; } } http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.3&r2=1.6.2.4&diff_format=u Index: phd/include/PhDBuildOptions.class.php diff -u phd/include/PhDBuildOptions.class.php:1.6.2.3 phd/include/PhDBuildOptions.class.php:1.6.2.4 --- phd/include/PhDBuildOptions.class.php:1.6.2.3 Thu Jul 31 21:23:19 2008 +++ phd/include/PhDBuildOptions.class.php Fri Aug 1 11:02:04 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDBuildOptions.class.php,v 1.6.2.3 2008/07/31 21:23:19 loudi Exp $ */ +/* $Id: PhDBuildOptions.class.php,v 1.6.2.4 2008/08/01 11:02:04 loudi Exp $ */ class PhDBuildOptionsParser extends PhDOptionParser { @@ -225,8 +225,15 @@ public function option_version($k, $v) { - printf("PhD version: %s\n", PHD_VERSION); - printf("Copyright (c) 2008 The PHP Documentation Group\n"); + $color = PhDConfig::phd_info_color(); + $output = PhDConfig::phd_info_output(); + if (isset($GLOBALS['base_revision'])) { + $rev = preg_replace('/\$Re[v](?:ision)?(: ([\d.]+) ?)?\$$/e', "'\\1' == '' ? '??' : '\\2'", $GLOBALS['base_revision']); + fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION . " (" . $rev . ")", $color)); + } else { + fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION, $color)); + } + fprintf($output, "%s\n", term_color("Copyright(c) 2008 The PHP Documentation Group", $color)); exit(0); } http://cvs.php.net/viewvc.cgi/phd/include/PhDErrors.php?r1=1.3&r2=1.3.4.1&diff_format=u Index: phd/include/PhDErrors.php diff -u phd/include/PhDErrors.php:1.3 phd/include/PhDErrors.php:1.3.4.1 --- phd/include/PhDErrors.php:1.3 Sat May 24 15:04:50 2008 +++ phd/include/PhDErrors.php Fri Aug 1 11:02:04 2008 @@ -1,26 +1,40 @@ <?php -/* $Id: PhDErrors.php,v 1.3 2008/05/24 15:04:50 gwynne Exp $ */ +/* $Id: PhDErrors.php,v 1.3.4.1 2008/08/01 11:02:04 loudi Exp $ */ /* {{{ PhD error & message handler */ -// FC For PHP5.3 -if (!defined("E_DEPRECATED")) { - define("E_DEPRECATED", E_RECOVERABLE_ERROR << 1); +$error_map = array( + E_RECOVERABLE_ERROR => 'PHP Error', + E_WARNING => 'PHP Warning', + E_NOTICE => 'PHP Notice', + E_STRICT => 'PHP Strict Standards Warning', + E_DEPRECATED => 'PHP Deprecated Construct Warning', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', +); + +function define_error($name, $explanation) { + static $lastErrorValue = E_DEPRECATED; + + define($name, $lastErrorValue <<= 1); + $GLOBALS['error_map'][$lastErrorValue] = $explanation; } // PhD verbose flags -define('VERBOSE_INDEXING', E_DEPRECATED << 1); -define('VERBOSE_FORMAT_RENDERING', VERBOSE_INDEXING << 1); -define('VERBOSE_THEME_RENDERING', VERBOSE_FORMAT_RENDERING << 1); -define('VERBOSE_RENDER_STYLE', VERBOSE_THEME_RENDERING << 1); -define('VERBOSE_PARTIAL_READING', VERBOSE_RENDER_STYLE << 1); -define('VERBOSE_PARTIAL_CHILD_READING', VERBOSE_PARTIAL_READING << 1); -define('VERBOSE_TOC_WRITING', VERBOSE_PARTIAL_CHILD_READING << 1); -define('VERBOSE_CHUNK_WRITING', VERBOSE_TOC_WRITING << 1); -define('VERBOSE_NOVERSION', VERBOSE_CHUNK_WRITING << 1); +define_error('VERBOSE_INDEXING', 'PhD Indexer'); +define_error('VERBOSE_FORMAT_RENDERING', 'PhD Output Format'); +define_error('VERBOSE_THEME_RENDERING', 'PhD Output Theme'); +define_error('VERBOSE_RENDER_STYLE', 'PhD Rendering Style'); +define_error('VERBOSE_PARTIAL_READING', 'PhD Partial Reader'); +define_error('VERBOSE_PARTIAL_CHILD_READING', 'PhD Partial Child Reader'); +define_error('VERBOSE_TOC_WRITING', 'PhD TOC Writer'); +define_error('VERBOSE_CHUNK_WRITING', 'PhD Chunk Writer'); +define_error('VERBOSE_NOVERSION', 'Missing Version Information'); +define_error('VERBOSE_DONE', 'PhD Processing Completion'); -define('VERBOSE_ALL', (VERBOSE_NOVERSION << 1)-1); -define('VERBOSE_DEFAULT', (VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING|VERBOSE_NOVERSION))); +define('VERBOSE_ALL', (VERBOSE_NOVERSION << 1)-1); +define('VERBOSE_DEFAULT', (VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING|VERBOSE_NOVERSION|VERBOSE_DONE))); $olderrrep = error_reporting(); error_reporting($olderrrep | VERBOSE_DEFAULT); @@ -47,27 +61,6 @@ /* {{{ The PhD errorhandler */ function errh($errno, $msg, $file, $line, $ctx = null) { - static $err = array( - E_DEPRECATED => 'E_DEPRECATED', - E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', - E_STRICT => 'E_STRICT', - E_WARNING => 'E_WARNING', - E_NOTICE => 'E_NOTICE', - - E_USER_ERROR => 'E_USER_ERROR', - E_USER_WARNING => 'E_USER_WARNING', - E_USER_NOTICE => 'E_USER_NOTICE', - - VERBOSE_INDEXING => 'VERBOSE_INDEXING', - VERBOSE_FORMAT_RENDERING => 'VERBOSE_FORMAT_RENDERING', - VERBOSE_THEME_RENDERING => 'VERBOSE_THEME_RENDERING', - VERBOSE_RENDER_STYLE => 'VERBOSE_RENDER_STYLE', - VERBOSE_PARTIAL_READING => 'VERBOSE_PARTIAL_READING', - VERBOSE_PARTIAL_CHILD_READING => 'VERBOSE_PARTIAL_CHILD_READING', - VERBOSE_TOC_WRITING => 'VERBOSE_TOC_WRITING', - VERBOSE_CHUNK_WRITING => 'VERBOSE_CHUNK_WRITING', - VERBOSE_NOVERSION => 'VERBOSE_NOVERSION', - ); static $recursive = false; // Respect the error_reporting setting @@ -93,6 +86,7 @@ case VERBOSE_TOC_WRITING: case VERBOSE_CHUNK_WRITING: case VERBOSE_NOVERSION: + case VERBOSE_DONE: $color = PhDConfig::phd_info_color(); $output = PhDConfig::phd_info_output(); $data = $msg; @@ -123,7 +117,7 @@ return false; } - $timestamp = term_color(sprintf("[%s - %s]", $time, $err[$errno]), $color); + $timestamp = term_color(sprintf("[%s - %s]", $time, $GLOBALS['error_map'][$errno]), $color); fprintf($output, "%s %s\n", $timestamp, $data); // Abort on fatal errors
http://cvs.php.net/viewvc.cgi/phd/config.php?r1=1.53.2.2&r2=1.53.2.3&diff_format=u Index: phd/config.php diff -u phd/config.php:1.53.2.2 phd/config.php:1.53.2.3 --- phd/config.php:1.53.2.2 Wed Jul 30 12:17:20 2008 +++ phd/config.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: config.php,v 1.53.2.2 2008/07/30 12:17:20 loudi Exp $ */ +/* $Id: config.php,v 1.53.2.3 2008/08/01 11:02:03 loudi Exp $ */ require $ROOT . "/include/PhDErrors.php"; @@ -30,6 +30,7 @@ ), 'color_output' => false, 'output_dir' => './', + 'intermediate_output_dir' => '.', 'php_error_output' => NULL, 'php_error_color' => false, 'user_error_output' => NULL, http://cvs.php.net/viewvc.cgi/phd/render.php?r1=1.3.2.6&r2=1.3.2.7&diff_format=u Index: phd/render.php diff -u phd/render.php:1.3.2.6 phd/render.php:1.3.2.7 --- phd/render.php:1.3.2.6 Thu Jul 31 21:23:19 2008 +++ phd/render.php Fri Aug 1 11:02:03 2008 @@ -20,6 +20,11 @@ //$INDEX = $FILENAME = "/home/bjori/php/cleandocs/json.xml"; define("NO_SQLITE", false); +/* If no docbook file was passed, die */ +if (!is_dir(PhDConfig::xml_root()) || !is_file(PhDConfig::xml_file())) { + trigger_error("No '.manual.xml' file was given. Specify it on the command line with --docbook.", E_USER_ERROR); +} + PhDConfig::init(array( "verbose" => VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING), "lang_dir" => $ROOT . DIRECTORY_SEPARATOR . "include" . DIRECTORY_SEPARATOR . "langs" . DIRECTORY_SEPARATOR, http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.68.2.4&r2=1.68.2.5&diff_format=u Index: phd/formats/xhtml.php diff -u phd/formats/xhtml.php:1.68.2.4 phd/formats/xhtml.php:1.68.2.5 --- phd/formats/xhtml.php:1.68.2.4 Thu Jul 31 21:23:19 2008 +++ phd/formats/xhtml.php Fri Aug 1 11:02:03 2008 @@ -1,6 +1,7 @@ <?php -/* $Id: xhtml.php,v 1.68.2.4 2008/07/31 21:23:19 loudi Exp $ */ +/* $Id: xhtml.php,v 1.68.2.5 2008/08/01 11:02:03 loudi Exp $ */ class PhDXHTMLFormat extends PhDFormat { + private $simpleName = "XHTML"; private $myelementmap = array( /* {{{ */ 'abstract' => 'div', /* Docbook-xsl prints "abstract"... */ 'abbrev' => 'abbr', @@ -594,6 +595,10 @@ $this->registerTextMap(static::getDefaultTextMap()); } break; + + case PhDRender::INIT: + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); + break; } } http://cvs.php.net/viewvc.cgi/phd/formats/php.php?r1=1.4.2.4&r2=1.4.2.5&diff_format=u Index: phd/formats/php.php diff -u phd/formats/php.php:1.4.2.4 phd/formats/php.php:1.4.2.5 --- phd/formats/php.php:1.4.2.4 Wed Jul 30 12:17:21 2008 +++ phd/formats/php.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,6 @@ <?php class PhDPHPFormat extends PhDXHTMLFormat { + private $simpleName = "PHP"; private $myelementmap = array( 'acronym' => 'format_suppressed_tags', 'function' => 'format_suppressed_tags', @@ -132,6 +133,10 @@ $this->registerTextMap(static::getDefaultTextMap()); } break; + + case PhDRender::INIT: + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); + break; } } public function format_suppressed_text($value, $tag) { http://cvs.php.net/viewvc.cgi/phd/formats/bigxhtml.php?r1=1.2.2.4&r2=1.2.2.5&diff_format=u Index: phd/formats/bigxhtml.php diff -u phd/formats/bigxhtml.php:1.2.2.4 phd/formats/bigxhtml.php:1.2.2.5 --- phd/formats/bigxhtml.php:1.2.2.4 Wed Jul 30 12:17:21 2008 +++ phd/formats/bigxhtml.php Fri Aug 1 11:02:03 2008 @@ -1,5 +1,6 @@ <?php class PhDBigXHTMLFormat extends PhDXHTMLFormat { + private $simpleName = "Big-XHTML"; private $myelementmap = array( 'link' => 'format_link', 'xref' => 'format_xref', @@ -112,6 +113,7 @@ } else { $this->close(); } + v("Starting %s rendering", $this->simpleName, VERBOSE_FORMAT_RENDERING); break; } } http://cvs.php.net/viewvc.cgi/phd/include/PhDBuildOptions.class.php?r1=1.6.2.3&r2=1.6.2.4&diff_format=u Index: phd/include/PhDBuildOptions.class.php diff -u phd/include/PhDBuildOptions.class.php:1.6.2.3 phd/include/PhDBuildOptions.class.php:1.6.2.4 --- phd/include/PhDBuildOptions.class.php:1.6.2.3 Thu Jul 31 21:23:19 2008 +++ phd/include/PhDBuildOptions.class.php Fri Aug 1 11:02:04 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: PhDBuildOptions.class.php,v 1.6.2.3 2008/07/31 21:23:19 loudi Exp $ */ +/* $Id: PhDBuildOptions.class.php,v 1.6.2.4 2008/08/01 11:02:04 loudi Exp $ */ class PhDBuildOptionsParser extends PhDOptionParser { @@ -225,8 +225,15 @@ public function option_version($k, $v) { - printf("PhD version: %s\n", PHD_VERSION); - printf("Copyright (c) 2008 The PHP Documentation Group\n"); + $color = PhDConfig::phd_info_color(); + $output = PhDConfig::phd_info_output(); + if (isset($GLOBALS['base_revision'])) { + $rev = preg_replace('/\$Re[v](?:ision)?(: ([\d.]+) ?)?\$$/e', "'\\1' == '' ? '??' : '\\2'", $GLOBALS['base_revision']); + fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION . " (" . $rev . ")", $color)); + } else { + fprintf($output, "%s\n", term_color("PhD Version: " . PHD_VERSION, $color)); + } + fprintf($output, "%s\n", term_color("Copyright(c) 2008 The PHP Documentation Group", $color)); exit(0); } http://cvs.php.net/viewvc.cgi/phd/include/PhDErrors.php?r1=1.3&r2=1.3.4.1&diff_format=u Index: phd/include/PhDErrors.php diff -u phd/include/PhDErrors.php:1.3 phd/include/PhDErrors.php:1.3.4.1 --- phd/include/PhDErrors.php:1.3 Sat May 24 15:04:50 2008 +++ phd/include/PhDErrors.php Fri Aug 1 11:02:04 2008 @@ -1,26 +1,40 @@ <?php -/* $Id: PhDErrors.php,v 1.3 2008/05/24 15:04:50 gwynne Exp $ */ +/* $Id: PhDErrors.php,v 1.3.4.1 2008/08/01 11:02:04 loudi Exp $ */ /* {{{ PhD error & message handler */ -// FC For PHP5.3 -if (!defined("E_DEPRECATED")) { - define("E_DEPRECATED", E_RECOVERABLE_ERROR << 1); +$error_map = array( + E_RECOVERABLE_ERROR => 'PHP Error', + E_WARNING => 'PHP Warning', + E_NOTICE => 'PHP Notice', + E_STRICT => 'PHP Strict Standards Warning', + E_DEPRECATED => 'PHP Deprecated Construct Warning', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', +); + +function define_error($name, $explanation) { + static $lastErrorValue = E_DEPRECATED; + + define($name, $lastErrorValue <<= 1); + $GLOBALS['error_map'][$lastErrorValue] = $explanation; } // PhD verbose flags -define('VERBOSE_INDEXING', E_DEPRECATED << 1); -define('VERBOSE_FORMAT_RENDERING', VERBOSE_INDEXING << 1); -define('VERBOSE_THEME_RENDERING', VERBOSE_FORMAT_RENDERING << 1); -define('VERBOSE_RENDER_STYLE', VERBOSE_THEME_RENDERING << 1); -define('VERBOSE_PARTIAL_READING', VERBOSE_RENDER_STYLE << 1); -define('VERBOSE_PARTIAL_CHILD_READING', VERBOSE_PARTIAL_READING << 1); -define('VERBOSE_TOC_WRITING', VERBOSE_PARTIAL_CHILD_READING << 1); -define('VERBOSE_CHUNK_WRITING', VERBOSE_TOC_WRITING << 1); -define('VERBOSE_NOVERSION', VERBOSE_CHUNK_WRITING << 1); +define_error('VERBOSE_INDEXING', 'PhD Indexer'); +define_error('VERBOSE_FORMAT_RENDERING', 'PhD Output Format'); +define_error('VERBOSE_THEME_RENDERING', 'PhD Output Theme'); +define_error('VERBOSE_RENDER_STYLE', 'PhD Rendering Style'); +define_error('VERBOSE_PARTIAL_READING', 'PhD Partial Reader'); +define_error('VERBOSE_PARTIAL_CHILD_READING', 'PhD Partial Child Reader'); +define_error('VERBOSE_TOC_WRITING', 'PhD TOC Writer'); +define_error('VERBOSE_CHUNK_WRITING', 'PhD Chunk Writer'); +define_error('VERBOSE_NOVERSION', 'Missing Version Information'); +define_error('VERBOSE_DONE', 'PhD Processing Completion'); -define('VERBOSE_ALL', (VERBOSE_NOVERSION << 1)-1); -define('VERBOSE_DEFAULT', (VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING|VERBOSE_NOVERSION))); +define('VERBOSE_ALL', (VERBOSE_NOVERSION << 1)-1); +define('VERBOSE_DEFAULT', (VERBOSE_ALL^(VERBOSE_PARTIAL_CHILD_READING|VERBOSE_CHUNK_WRITING|VERBOSE_NOVERSION|VERBOSE_DONE))); $olderrrep = error_reporting(); error_reporting($olderrrep | VERBOSE_DEFAULT); @@ -47,27 +61,6 @@ /* {{{ The PhD errorhandler */ function errh($errno, $msg, $file, $line, $ctx = null) { - static $err = array( - E_DEPRECATED => 'E_DEPRECATED', - E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR', - E_STRICT => 'E_STRICT', - E_WARNING => 'E_WARNING', - E_NOTICE => 'E_NOTICE', - - E_USER_ERROR => 'E_USER_ERROR', - E_USER_WARNING => 'E_USER_WARNING', - E_USER_NOTICE => 'E_USER_NOTICE', - - VERBOSE_INDEXING => 'VERBOSE_INDEXING', - VERBOSE_FORMAT_RENDERING => 'VERBOSE_FORMAT_RENDERING', - VERBOSE_THEME_RENDERING => 'VERBOSE_THEME_RENDERING', - VERBOSE_RENDER_STYLE => 'VERBOSE_RENDER_STYLE', - VERBOSE_PARTIAL_READING => 'VERBOSE_PARTIAL_READING', - VERBOSE_PARTIAL_CHILD_READING => 'VERBOSE_PARTIAL_CHILD_READING', - VERBOSE_TOC_WRITING => 'VERBOSE_TOC_WRITING', - VERBOSE_CHUNK_WRITING => 'VERBOSE_CHUNK_WRITING', - VERBOSE_NOVERSION => 'VERBOSE_NOVERSION', - ); static $recursive = false; // Respect the error_reporting setting @@ -93,6 +86,7 @@ case VERBOSE_TOC_WRITING: case VERBOSE_CHUNK_WRITING: case VERBOSE_NOVERSION: + case VERBOSE_DONE: $color = PhDConfig::phd_info_color(); $output = PhDConfig::phd_info_output(); $data = $msg; @@ -123,7 +117,7 @@ return false; } - $timestamp = term_color(sprintf("[%s - %s]", $time, $err[$errno]), $color); + $timestamp = term_color(sprintf("[%s - %s]", $time, $GLOBALS['error_map'][$errno]), $color); fprintf($output, "%s %s\n", $timestamp, $data); // Abort on fatal errors