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