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 file 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.
 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 cDebugFile implements cDebugInterface {
 28: 
 29:     /**
 30:      * Singleton instance
 31:      *
 32:      * @var cDebugFile
 33:      */
 34:     private static $_instance;
 35: 
 36:     /**
 37:      *
 38:      * @var string
 39:      */
 40:     private $_sPathToLogs;
 41: 
 42:     /**
 43:      *
 44:      * @var string
 45:      */
 46:     private $_sFileName;
 47: 
 48:     /**
 49:      *
 50:      * @var string
 51:      */
 52:     private $_sPathToFile;
 53: 
 54:     /**
 55:      * Return singleton instance.
 56:      *
 57:      * @return cDebugFile
 58:      */
 59:     public static function getInstance() {
 60:         if (self::$_instance == NULL) {
 61:             self::$_instance = new cDebugFile();
 62:         }
 63:         return self::$_instance;
 64:     }
 65: 
 66:     /**
 67:      * Constructor
 68:      * Opens filehandle for debug-logfile
 69:      */
 70:     private function __construct() {
 71:         global $cfg; // omfg, I know... TODO
 72:         $this->_sPathToLogs = $cfg['path']['contenido_logs'];
 73:         $this->_sFileName = 'debug.log';
 74:         $this->_sPathToFile = $this->_sPathToLogs . $this->_sFileName;
 75:     }
 76: 
 77:     /**
 78:      * (non-PHPdoc)
 79:      *
 80:      * @see cDebugInterface::out()
 81:      */
 82:     public function out($msg) {
 83:         if (cFileHandler::writeable($this->_sPathToFile)) {
 84:             $sDate = date('Y-m-d H:i:s');
 85:             cFileHandler::write($this->_sPathToFile, $sDate . ": " . $msg . "\n", true);
 86:         }
 87:     }
 88: 
 89:     /**
 90:      * Outputs contents of passed variable in a preformatted, readable way
 91:      *
 92:      * @param mixed $mVariable The variable to be displayed
 93:      * @param string $sVariableDescription The variable's name or description
 94:      * @param bool $bExit If set to true, your app will die() after output of
 95:      *        current var
 96:      */
 97:     public function show($mVariable, $sVariableDescription = '', $bExit = false) {
 98:         if (cFileHandler::writeable($this->_sPathToFile)) {
 99:             $sDate = date('Y-m-d H:i:s');
100:             cFileHandler::write($this->_sPathToFile, '#################### ' . $sDate . ' ####################' . "\n", true);
101:             cFileHandler::write($this->_sPathToFile, $sVariableDescription . "\n", true);
102:             cFileHandler::write($this->_sPathToFile, print_r($mVariable, true) . "\n", true);
103:             cFileHandler::write($this->_sPathToFile, '#################### /' . $sDate . ' ###################' . "\n\n", true);
104:         }
105:     }
106: 
107:     /**
108:      * Interface implementation
109:      *
110:      * @param mixed $mVariable
111:      * @param string $sVariableDescription
112:      */
113:     public function add($mVariable, $sVariableDescription = '') {
114:     }
115: 
116:     /**
117:      * Interface implementation
118:      */
119:     public function reset() {
120:     }
121: 
122:     /**
123:      * Interface implementation
124:      */
125:     public function showAll() {
126:     }
127: }
128: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0