Exemplo n.º 1
0
 /**
  * Debug_Renderer_HTML_Table class constructor
  * 
  * @since V2.0.0 - 13 apr 2006
  */
 function __construct($DebugObject, $options)
 {
     $this->DebugObject = $DebugObject;
     $this->defaultOptions = PHP_Debug_Renderer_HTML_TableConfig::singleton()->getConfig();
     $this->setOptions($options);
     // Now add in first the predefined debugline depending on the configuration
     if ($this->options['HTML_TABLE_enable_search'] == true) {
         $this->DebugObject->addDebugFirst('', PHP_DebugLine::TYPE_SEARCH);
     }
     if ($this->options['HTML_TABLE_disable_credits'] == false) {
         $this->DebugObject->addDebugFirst($this->options['HTML_TABLE_credits'], PHP_DebugLine::TYPE_CREDITS);
     }
     // Now add in last positions the others predefined debuglines
     // Add execution time
     $this->DebugObject->addDebug('', PHP_DebugLine::TYPE_PROCESSPERF);
     // Add templates
     if ($this->options['HTML_TABLE_show_templates'] == true) {
         $this->DebugObject->addDebug(STR_N, PHP_DebugLine::TYPE_TEMPLATES);
     }
     // Add env variables
     $this->addSuperArray();
 }
Exemplo n.º 2
0
 * 
 * @version    CVS: $Id$
 */
// View source configuration (to modify with your settings)
$view_source_options = array('PEAR_ROOT' => 'W:/var/www/php/PEAR', 'CSS_ROOT' => 'css', 'ALLOWED_PATH' => array('/media/sf_sandbox'));
// Files that are allowed to be viewed
$pathPattern = '/^{$path}(.*)(.php)$/';
// Additional include path for Pear (to adapt to your configuration )
//set_include_path($options['PEAR_ROOT'] . PATH_SEPARATOR. get_include_path());
// End //
//Include Pear
require_once 'PEAR.php';
//Include Debug_Renderer_HTML_Table_Config to get the configuration
require_once 'PHP/Debug.php';
require_once 'PHP/Debug/Renderer/HTML/TableConfig.php';
$options = PHP_Debug_Renderer_HTML_TableConfig::singleton()->getConfig();
//Include the class definition of highlighter
require_once 'Text/Highlighter.php';
require_once 'Text/Highlighter/Renderer/Html.php';
/**
 * Security test
 */
function isPathAllowed($file)
{
    global $view_source_options, $pathPattern;
    $allowed = false;
    $file = get_magic_quotes_gpc() ? stripslashes($file) : $file;
    foreach ($view_source_options['ALLOWED_PATH'] as $path) {
        $pattern = str_replace('{$path}', regPath(preg_quote($path)), $pathPattern);
        if (preg_match($pattern, $file)) {
            $allowed = true;
Exemplo n.º 3
0
 /**
  * returns the static instance of the class
  *
  * @since V2.0.0 - 11 apr 2006
  * @see PHP_Debug
  */
 public static function singleton()
 {
     if (!isset(self::$instance)) {
         $class = __CLASS__;
         self::$instance = new $class();
     }
     return self::$instance;
 }