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 file and vis adv 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 write info to a file and 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/logs/debug.log.
23:  *
24:  * @package    Core
25:  * @subpackage Debug
26:  */
27: class cDebugFileAndVisAdv extends cDebugVisibleAdv {
28: 
29:     protected static $_instance;
30: 
31:     private $_aItems;
32: 
33:     private $_filePathName;
34: 
35:     private function __construct() {
36:         global $cfg;
37:         $this->_aItems = array();
38:         $this->_filePathName = $cfg['path']['contenido_logs'] . 'debug.log';
39:     }
40: 
41:     static public function getInstance() {
42:         if (self::$_instance == null) {
43:             self::$_instance = new cDebugFileAndVisAdv();
44:         }
45:         return self::$_instance;
46:     }
47: 
48:     public function out($msg) {
49:         parent::out($msg);
50: 
51:         if (is_writeable($this->_filePathName)) {
52:             $sDate = date('Y-m-d H:i:s');
53:             cFileHandler::write($this->_filePathName, $sDate . ": " . $msg . "\n", true);
54:         }
55:     }
56: 
57:     public function show($mVariable, $sVariableDescription = '', $bExit = false) {
58:         parent::show($mVariable, $sVariableDescription, $bExit);
59: 
60:         if (is_writeable($this->_filePathName)) {
61:             $sDate = date('Y-m-d H:i:s');
62:             $sContent = '#################### ' . $sDate . ' ####################' . "\n" . $sVariableDescription . "\n" . print_r($mVariable, true) . "\n" . '#################### /' . $sDate . ' ###################' . "\n\n";
63:             cFileHandler::write($this->_filePathName, $sContent, true);
64:         }
65:     }
66: 
67: }
68: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0