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
    • NavigationMain
    • 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:     private static $_instance;
 30: 
 31:     /**
 32:      * Constructor
 33:      */
 34:     private function __construct() {
 35:     }
 36: 
 37:     /**
 38:      * static
 39:      */
 40:     static public function getInstance() {
 41:         if (self::$_instance == null) {
 42:             self::$_instance = new cDebugVisible();
 43:         }
 44:         return self::$_instance;
 45:     }
 46: 
 47:     public function out($msg) {
 48:     }
 49: 
 50:     /**
 51:      * Outputs contents of passed variable in a preformatted, readable way
 52:      *
 53:      * @param mixed $mVariable The variable to be displayed
 54:      * @param string $sVariableDescription The variable's name or description
 55:      * @param boolean $bExit If set to true, your app will die() after output of
 56:      *        current var
 57:      */
 58:     public function show($mVariable, $sVariableDescription = '', $bExit = false) {
 59:         $bTextarea = false;
 60:         $bPlainText = false;
 61:         if (is_array($mVariable)) {
 62:             if (sizeof($mVariable) > 10) {
 63:                 $bTextarea = true;
 64:             } else {
 65:                 $bPlainText = true;
 66:             }
 67:         }
 68:         if (is_object($mVariable)) {
 69:             $bTextarea = true;
 70:         }
 71:         if (is_string($mVariable)) {
 72:             if (preg_match('/<(.*)>/', $mVariable)) {
 73:                 if (strlen($mVariable) > 40) {
 74:                     $bTextarea = true;
 75:                 } else {
 76:                     $bPlainText = true;
 77:                     $mVariable = conHtmlSpecialChars($mVariable);
 78:                 }
 79:             } else {
 80:                 $bPlainText = true;
 81:             }
 82:         }
 83: 
 84:         $tpl = new cTemplate();
 85:         $tpl->set("s", "VAR_DESCRIPTION", $sVariableDescription);
 86:         $varText = "";
 87:         if ($bTextarea === true) {
 88:             $varText .= '<textarea rows="10" cols="100">';
 89:         } elseif ($bPlainText === true) {
 90:             $varText .= '<pre class="debug_output">';
 91:         } else {
 92:             $varText .= '<pre class="debug_output">';
 93:         }
 94: 
 95:         if (is_array($mVariable)) {
 96:             $varText .= print_r($mVariable, true);
 97:         } else {
 98:             $varText .= var_dump($mVariable, true);
 99:         }
100: 
101:         if ($bTextarea === true) {
102:             $varText .= '</textarea>';
103:         } elseif ($bPlainText === true) {
104:             $varText .= '</pre>';
105:         } else {
106:             $varText .= '</pre>';
107:         }
108:         $tpl->set("s", "VAR_TEXT", $varText);
109: 
110:         global $cfg;
111: 
112:         $tpl->generate($cfg["templates"]["debug_visible"]);
113:         if ($bExit === true) {
114:             die('<p class="debug_footer"><b>debugg\'ed</b></p>');
115:         }
116:     }
117: 
118:     /**
119:      * Interface implementation
120:      *
121:      * @param mixed $mVariable
122:      * @param string $sVariableDescription
123:      */
124:     public function add($mVariable, $sVariableDescription = '') {
125:     }
126: 
127:     /**
128:      * Interface implementation
129:      */
130:     public function reset() {
131:     }
132: 
133:     /**
134:      * Interface implementation
135:      */
136:     public function showAll() {
137:     }
138: 
139: }
140: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0