PHP_Debug
[ class tree: PHP_Debug ] [ index: PHP_Debug ] [ all elements ]

Source for file DivConfig.php

Documentation is available at DivConfig.php

  1. <?php
  2.  
  3. /**
  4.  * Configuration file for HTML_Div renderer
  5.  *
  6.  * @package PHP_Debug
  7.  * @category PHP
  8.  * @author Loïc Vernet <qrf_coil at yahoo dot fr>
  9.  * @since V2.1.0 - 29 march 2007
  10.  * 
  11.  * @package PHP_Debug
  12.  * @filesource
  13.  * 
  14.  * @version    CVS: $Id: DivConfig.php,v 1.3 2008/10/05 14:41:37 c0il Exp $
  15.  */
  16.  
  17. {    
  18.     /**
  19.      * Config container for Debug_Renderer_HTML_Div
  20.      * 
  21.      * @var array 
  22.      * @since V2.0.0 - 11 apr 2006
  23.      */
  24.     protected static $options = array();
  25.  
  26.     /**
  27.      * Static Instance of class
  28.      *  
  29.      * @var array 
  30.      * @since V2.0.0 - 11 apr 2006
  31.      */
  32.     protected static $instance = null;
  33.         
  34.     /**
  35.      * Debug_Renderer_HTML_DIV_Config class constructor
  36.      * 
  37.      * @since V2.0.0 - 11 apr 2006
  38.      */
  39.     protected function __construct()
  40.     {
  41.         /**
  42.          * Enable or disable Credits in debug infos 
  43.          */
  44.         self::$options['HTML_DIV_disable_credits'= false;
  45.  
  46.         /**
  47.          * Enable or disable pattern removing in included files
  48.          */
  49.         self::$options['HTML_DIV_remove_templates_pattern'= false;
  50.         
  51.         /**
  52.          * Pattern list to remove in the display of included files
  53.          * if HTML_DIV_remove_templates_pattern is set to true
  54.          */ 
  55.         self::$options['HTML_DIV_templates_pattern'= array()
  56.  
  57.         /** 
  58.          * View Source script path
  59.          */
  60.         self::$options['HTML_DIV_view_source_script_path''.';  
  61.         
  62.         /** 
  63.          * View source script file name
  64.          */     
  65.         self::$options['HTML_DIV_view_source_script_name''PHP_Debug_ShowSource.php'
  66.  
  67.         /** 
  68.          * Tabsize for view source script
  69.          */     
  70.         self::$options['HTML_DIV_view_source_tabsize'= 4; 
  71.  
  72.         /** 
  73.          * Tabsize for view source script
  74.          */     
  75.         self::$options['HTML_DIV_view_source_numbers'= 2; //HL_NUMBERS_TABLE
  76.  
  77.         /** 
  78.          * images
  79.          */     
  80.         self::$options['HTML_DIV_images_path''images'
  81.         self::$options['HTML_DIV_image_info''info.png'
  82.         self::$options['HTML_DIV_image_warning''warning.png'
  83.         self::$options['HTML_DIV_image_error''error.png'
  84.  
  85.         /** 
  86.          * css path
  87.          */     
  88.         self::$options['HTML_DIV_css_path''css'
  89.  
  90.         /** 
  91.          * js path
  92.          */     
  93.         self::$options['HTML_DIV_js_path''js'
  94.         
  95.         /**
  96.          * Class name of the debug info levels
  97.          */
  98.         self::$options['HTML_DIV_debug_level_classes'= array(
  99.             PHP_DebugLine::INFO_LEVEL     => 'sfWebDebugInfo',
  100.             PHP_DebugLine::WARNING_LEVEL  => 'sfWebDebugWarning',
  101.             PHP_DebugLine::ERROR_LEVEL    => 'sfWebDebugError',
  102.         );
  103.  
  104.         /**
  105.          * After this goes all HTML related variables
  106.          * 
  107.          * HTML code for header 
  108.          */         
  109.          self::$options['HTML_DIV_header''
  110. <div id="sfWebDebug">
  111.  
  112.     <div id="sfWebDebugBar" class="sfWebDebugInfo">
  113.         <div id="title">
  114.             <a href="#" onclick="sfWebDebugToggleMenu(); return false;"><b>&raquo; PHP_Debug</b></a>
  115.         </div>
  116.         <ul id="sfWebDebugDetails" class="menu">
  117.             <li>{$phpDebugVersion}</li>
  118.             <li><a href="#" onclick="sfWebDebugShowDetailsFor(\'sfWebDebugConfig\'); return false;"><img src="{$imagesPath}/config.png" alt="Config" /> vars &amp; config</a></li>
  119.             <li><a href="#" onclick="sfWebDebugShowDetailsFor(\'sfWebDebugLog\'); return false;"><img src="{$imagesPath}/comment.png" alt="Comment" /> logs &amp; msgs</a></li>
  120.             <li><a href="#" onclick="sfWebDebugShowDetailsFor(\'sfWebDebugDatabaseDetails\'); return false;"><img src="{$imagesPath}/database.png" alt="Database" /> {$nb_queries}</a></li>
  121.             <li><a href="#" onclick="sfWebDebugShowDetailsFor(\'sfWebDebugW3CDetails\'); return false;">W3C</a></li>
  122.             <li class="last"><a href="#" onclick="sfWebDebugShowDetailsFor(\'sfWebDebugTimeDetails\'); return false;"><img src="{$imagesPath}/time.png" alt="Time" /> {$exec_time} ms</a></li>
  123.         </ul>
  124.         <a href="#" onclick="document.getElementById(\'sfWebDebug\').style.display=\'none\'; return false;"><img src="{$imagesPath}/close.png" alt="Close" /></a>
  125.     </div> <!-- End sfWebDebugBar -->
  126.  
  127. ';
  128.  
  129.         /**
  130.          * HTML code for validation debug tab
  131.          */         
  132.          self::$options['HTML_DIV_sfWebDebugW3CDetails''
  133.  
  134.     <div id="sfWebDebugW3CDetails" class="top" style="display:none">
  135.         <h1>W3C validation</h1>
  136.         <p>Click on the WC3 logo to verify the validation or to check the errors</p>
  137.         <p>
  138.             <a href="http://validator.w3.org/check?uri=referer"><img
  139.                 src="{$imagesPath}/w3c_home_nb.png"
  140.                 alt="W3C Validator" /></a>
  141.         </p>
  142.         or copy paste the source here <a href="http://validator.w3.org/#validate_by_input">http://validator.w3.org/#validate_by_input</a>
  143.  
  144.     </div> <!-- End sfWebDebugW3CDetails -->
  145.  
  146. ';
  147.  
  148.         /**
  149.          * HTML code for a row of a validation error
  150.          */
  151.          self::$options['HTML_DIV_sfWebDebugW3CTableHeader'
  152.     <h2>{$title}</h2>
  153.         <table class="sfWebDebugLogs" style="width:600px">
  154.             <tr>
  155.                 <th>n°</th>
  156.                 <th>Line</th>
  157.                 <th>Col</th>
  158.                 <th>Message</th>
  159.             </tr>
  160. ';
  161.  
  162.         /**
  163.          * HTML code for a row of a validation error
  164.          */
  165.          self::$options['HTML_DIV_sfWebDebugW3CErrorRow''
  166.         <tr class="sfWebDebugLogLine {$type}">
  167.             <td class="sfWebDebugLogNumber">{$cpt}</td>
  168.             <td class="sfWebDebugLogLine">{$line}</td>
  169.             <td class="sfWebDebugLogCol">{$col}</td>
  170.             <td class="sfWebDebugLogMessage">
  171.                 {$message}
  172.             </td>
  173.         </tr>
  174. ';
  175.  
  176.         /**
  177.          * HTML code for debug time tab
  178.          */         
  179.          self::$options['HTML_DIV_sfWebDebugTimeDetails''
  180.  
  181.     <div id="sfWebDebugTimeDetails" class="top" style="display:none">
  182.         <h1>Timers</h1>
  183.         <table class="sfWebDebugLogs" style="width: 300px">
  184.             <tr>
  185.                 <th>type</th>
  186.                 <th>time (ms)</th>
  187.                 <th>percent</th>
  188.             </tr>
  189.             <tr>
  190.                 <td class="sfWebDebugLogTypePerf">{$txtExecutionTime}</td>
  191.                 <td style="text-align: right">{$processTime}</td>
  192.                 <td style="text-align: right">100%</td>
  193.             </tr>
  194.             <tr>
  195.                 <td class="sfWebDebugLogTypePerf">{$txtPHP}</td>
  196.                 <td style="text-align: right">{$phpTime}</td>
  197.                 <td style="text-align: right">{$phpPercent}%</td>
  198.             </tr>
  199.             <tr>
  200.                 <td class="sfWebDebugLogTypePerf">{$txtSQL}</td>
  201.                 <td style="text-align: right">{$sqlTime}</td>
  202.                 <td style="text-align: right">{$sqlPercent}% : {$queryCount} {$txtQuery}</td>
  203.             </tr>
  204.             {$buffer}
  205.         </table>
  206.     </div> <!-- End sfWebDebugTimeDetails -->
  207.  
  208. ';
  209.  
  210.         /**
  211.          * HTML code for database tab
  212.          */         
  213.          self::$options['HTML_DIV_sfWebDebugDatabaseDetails''
  214.  
  215.     <div id="sfWebDebugDatabaseDetails" class="top" style="display:none">
  216.         <h1>Database / SQL queries</h1>
  217.  
  218.         <div id="sfWebDebugDatabaseLogs">
  219.             <ol>
  220.                 {$buffer}
  221.             </ol>
  222.         </div>
  223.  
  224.     </div> <!-- End sfWebDebugDatabaseDetails -->
  225.  
  226. ';
  227.  
  228.         /**
  229.          * HTML code for Log & msg tab
  230.          */         
  231.     self::$options['HTML_DIV_sfWebDebugLog''
  232.  
  233.     <div id="sfWebDebugLog" class="top" style="display:none"><h1>Log and debug messages</h1>
  234.         <ul id="sfWebDebugLogMenu">
  235.             <li><a href="#" onclick="sfWebDebugToggleAllLogLines(true, \'sfWebDebugLogLine\'); return false;">[all]</a></li>
  236.             <li><a href="#" onclick="sfWebDebugToggleAllLogLines(false, \'sfWebDebugLogLine\'); return false;">[none]</a></li>
  237.             <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'info\'); return false;"><img src="{$imagesPath}/info.png" alt="Info" /></a></li>
  238.             <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'warning\'); return false;"><img src="{$imagesPath}/warning.png" alt="Warning" /></a></li>
  239.             <li><a href="#" onclick="sfWebDebugShowOnlyLogLines(\'error\'); return false;"><img src="{$imagesPath}/error.png" alt="Error" /></a></li>
  240.         </ul>
  241.  
  242.         <div id="sfWebDebugLogLines">
  243.             <table class="sfWebDebugLogs">
  244.                 <tr>
  245.                     <th>#</th>
  246.                     <th>type</th>
  247.                     <th>file</th>
  248.                     <th>line</th>
  249.                     <th>class</th>
  250.                     <th>function</th>
  251.                     <th>time</th>
  252.                     <th>message</th>
  253.                 </tr>
  254.                 {$buffer}
  255.             </table>
  256.         </div>
  257.     </div> <!-- End sfWebDebugLog -->
  258.  
  259. ';
  260.  
  261.         /**
  262.          * HTML code for Vars & config tab
  263.          */         
  264.     self::$options['HTML_DIV_sfWebDebugConfig''
  265.  
  266.     <div id="sfWebDebugConfig" class="top" style="display:none">
  267.         <h1>Configuration and request variables</h1>
  268.  
  269.         <h2>Request <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugRequest\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  270.  
  271.         <div id="sfWebDebugRequest" style="display:none">
  272. {$sfWebDebugRequest}
  273.         </div>
  274.  
  275.         <h2>Response <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugResponse\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  276.         <div id="sfWebDebugResponse" style="display:none">
  277. {$sfWebDebugResponse}
  278.         </div>
  279.  
  280.         <h2>Settings <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugSettings\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  281.         <div id="sfWebDebugSettings" style="display:none">
  282. {$sfWebDebugSettings}
  283.         </div>
  284.  
  285.         <h2>Constants <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugConstants\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  286.         <div id="sfWebDebugConstants" style="display:none">
  287. {$sfWebDebugConstants}
  288.         </div>
  289.         
  290.         <h2>Globals <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugGlobals\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  291.         <div id="sfWebDebugGlobals" style="display:none">
  292. {$sfWebDebugGlobals}
  293.         </div>
  294.  
  295.         <h2>Php <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugPhp\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  296.         <div id="sfWebDebugPhp" style="display:none">
  297. {$sfWebDebugPhp}
  298.         </div>
  299.  
  300.         <h2>Files <a href="#" onclick="sfWebDebugToggle(\'sfWebDebugFiles\'); return false;"><img src="{$imagesPath}/toggle.gif" alt="Toggle" /></a></h2>
  301.         <div id="sfWebDebugFiles" style="display:none">
  302. {$sfWebDebugFiles}
  303.         </div>
  304.  
  305.     </div> <!-- End sfWebDebugConfig -->
  306.  
  307. ';
  308.         
  309.         /**
  310.          * HTML code for credits 
  311.          */         
  312.          self::$options['HTML_DIV_credits''
  313.         PHP_Debug ['. PHP_Debug::PEAR_RELEASE .'] | By COil (2008) | 
  314.         <a href="http://www.strangebuzz.com">http://www.strangebuzz.com</a> | 
  315.         <a href="http://phpdebug.sourceforge.net/">PHP_Debug Project Home</a> | 
  316.         Original idea from the <a href="http://www.symfony-project.org/">symfony framework</a>        
  317.         ';
  318.  
  319.         /**
  320.          * HTML code for a basic header 
  321.          */         
  322.          self::$options['HTML_DIV_simple_header''<?xml version="1.0" encoding="UTF-8"?>
  323. <!DOCTYPE html 
  324.      PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  325.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  326. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  327.   <head>
  328.     <title>Pear::PHP_Debug</title>
  329.  
  330. ';
  331.  
  332.         /**
  333.          * HTML code for a basic footer 
  334.          */         
  335.          self::$options['HTML_DIV_simple_footer''
  336. </body>
  337. </html>
  338.  
  339. ';
  340.  
  341.         /**
  342.          * HTML code for footer 
  343.          */         
  344.          self::$options['HTML_DIV_footer''
  345.  
  346. </div> <!-- End div sfWebDebug -->
  347.  
  348. ';
  349.  
  350.     }
  351.  
  352.     /**
  353.      * returns the static instance of the class
  354.      *
  355.      * @since V2.0.0 - 11 apr 2006
  356.      * @see PHP_Debug
  357.      */
  358.     public static function singleton()
  359.     {
  360.         if (!isset(self::$instance)) {
  361.             $class = __CLASS__;
  362.             self::$instance = new $class;
  363.         }
  364.         return self::$instance;
  365.     }
  366.     
  367.     /**
  368.      * returns the configuration
  369.      *
  370.      * @since V2.0.0 - 07 apr 2006
  371.      * @see PHP_Debug
  372.      */
  373.     public static function getConfig()
  374.     {
  375.         return self::$options;
  376.     }
  377.     
  378.     /**
  379.      * HTML_DIV_Config
  380.      * 
  381.      * @since V2.0.0 - 26 Apr 2006
  382.      */
  383.     public function __toString()
  384.     {
  385.         return '<pre>'. PHP_Debug::dumpVar(
  386.             $this->singleton()->getConfig()
  387.             __CLASS__
  388.             false,
  389.             PHP_DEBUG_DUMP_ARR_STR)'</pre>';
  390.     }   
  391. }

Documentation generated on Mon, 11 Mar 2019 15:28:40 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.