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

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