Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cDebug
  • cDebugDevNull
  • cDebugFile
  • cDebugFileAndVisAdv
  • cDebugHidden
  • cDebugVisible
  • cDebugVisibleAdv
  • cDebugVisibleAdvItem

Interfaces

  • cDebugInterface
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the visible debug class.
  4:  *
  5:  * @package Core
  6:  * @subpackage Debug
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Rudi Bieller
 10:  * @copyright four for business AG <www.4fb.de>
 11:  * @license http://www.contenido.org/license/LIZENZ.txt
 12:  * @link http://www.4fb.de
 13:  * @link http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * Debug object to show info on screen.
 20:  * In case you cannot output directly to screen when debugging a live system,
 21:  * this object writes
 22:  * the info to a file located in /data/log/debug.log.
 23:  *
 24:  * @package Core
 25:  * @subpackage Debug
 26:  */
 27: class cDebugVisible implements cDebugInterface {
 28: 
 29:     /**
 30:      * Singleton instance
 31:      *
 32:      * @var cDebugVisible
 33:      */
 34:     private static $_instance;
 35: 
 36:     /**
 37:      * Return singleton instance.
 38:      *
 39:      * @return cDebugVisible
 40:      */
 41:     static public function getInstance() {
 42:         if (self::$_instance == NULL) {
 43:             self::$_instance = new cDebugVisible();
 44:         }
 45:         return self::$_instance;
 46:     }
 47: 
 48:     /**
 49:      * Constructor
 50:      */
 51:     private function __construct() {
 52:     }
 53: 
 54:     /**
 55:      * (non-PHPdoc)
 56:      *
 57:      * @see cDebugInterface::out()
 58:      */
 59:     public function out($msg) {
 60:     }
 61: 
 62:     /**
 63:      * Outputs contents of passed variable in a preformatted, readable way
 64:      *
 65:      * @param mixed $mVariable The variable to be displayed
 66:      * @param string $sVariableDescription The variable's name or description
 67:      * @param bool $bExit If set to true, your app will die() after output of
 68:      *        current var
 69:      */
 70:     public function show($mVariable, $sVariableDescription = '', $bExit = false) {
 71:         $bTextarea = false;
 72:         $bPlainText = false;
 73:         if (is_array($mVariable)) {
 74:             if (sizeof($mVariable) > 10) {
 75:                 $bTextarea = true;
 76:             } else {
 77:                 $bPlainText = true;
 78:             }
 79:         }
 80:         if (is_object($mVariable)) {
 81:             $bTextarea = true;
 82:         }
 83:         if (is_string($mVariable)) {
 84:             if (preg_match('/<(.*)>/', $mVariable)) {
 85:                 if (strlen($mVariable) > 40) {
 86:                     $bTextarea = true;
 87:                 } else {
 88:                     $bPlainText = true;
 89:                     $mVariable = conHtmlSpecialChars($mVariable);
 90:                 }
 91:             } else {
 92:                 $bPlainText = true;
 93:             }
 94:         }
 95: 
 96:         $tpl = new cTemplate();
 97:         $tpl->set("s", "VAR_DESCRIPTION", $sVariableDescription);
 98:         $varText = "";
 99:         if ($bTextarea === true) {
100:             $varText .= '<textarea rows="10" cols="100">';
101:         } elseif ($bPlainText === true) {
102:             $varText .= '<pre class="debug_output">';
103:         } else {
104:             $varText .= '<pre class="debug_output">';
105:         }
106: 
107:         if (is_array($mVariable)) {
108:             $varText .= print_r($mVariable, true);
109:         } else {
110:             $varText .= var_dump($mVariable, true);
111:         }
112: 
113:         if ($bTextarea === true) {
114:             $varText .= '</textarea>';
115:         } elseif ($bPlainText === true) {
116:             $varText .= '</pre>';
117:         } else {
118:             $varText .= '</pre>';
119:         }
120:         $tpl->set("s", "VAR_TEXT", $varText);
121: 
122:         global $cfg;
123: 
124:         $tpl->generate($cfg["templates"]["debug_visible"]);
125:         if ($bExit === true) {
126:             die('<p class="debug_footer"><b>debugg\'ed</b></p>');
127:         }
128:     }
129: 
130:     /**
131:      * Interface implementation
132:      *
133:      * @param mixed $mVariable
134:      * @param string $sVariableDescription
135:      */
136:     public function add($mVariable, $sVariableDescription = '') {
137:     }
138: 
139:     /**
140:      * Interface implementation
141:      */
142:     public function reset() {
143:     }
144: 
145:     /**
146:      * Interface implementation
147:      */
148:     public function showAll() {
149:     }
150: }
151: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0