Commit ba59200e by Frederick

init Dateien

1 parent 1e376b4e
<?php
/**
* @filesource class_D.inc.php
*
* @category losp
* @copyright Copyright by mensch.coop e.G. 2009
* @mailto dev [at] mensch.coop
* @version 0.4.200901
* @link http://mensch.coop
*/
/**
* Klasse ist für Ausgaben zuständig die
* a) nur für die Entwicklung relevant sind, also nicht für das Live System
* b) umgeleitet werden können, also nicht einfach nur ausgegeben werden, sondern in eine extra Datei
*/
class D {
private static $echo_count = 0;
public static $echo_lines = array();
private static function html2text($param_htmlstring) {
$html_elements = array();
$text_elements = array();
foreach(mcCONST::$HTMLTAGS2TEXT as $htmlstags => $stringels) {
$html_elements[] = $htmlstags;
$text_elements[] = $stringels;
}
// $param_htmlstring = str_replace(mcCONST::LINEBREAK, '', $param_htmlstring);
$textstring = str_replace($html_elements, $text_elements, $param_htmlstring);
return $textstring;
}
public static function e($param_string, $param_print=true, $param_force=false) {
self::new_echo($param_string, $param_print, $param_force);
}
public static function printToFile($param_filename, $param_kindof = null) {
if($param_filename && !empty(self::$echo_lines)) {
$file_content = '';
foreach(self::$echo_lines as $line_nr => $line) {
$file_content .= $line_nr.':'.mcCONST::TAB.self::html2text($line['line']).mcCONST::LINEBREAK;
}
mcFile::write($param_filename, $file_content, $param_kindof);
}
}
public static function printToScreen() {
if(!empty(self::$echo_lines)) {
$screen_content = '<br /><br /><br />';
foreach(self::$echo_lines as $line_nr => $line) {
$screen_content .= $line['line'];
}
echo $screen_content;
}
}
public static function printPDOQuery($param_query, array $param_bindValueArray=null, $param_print=true, $param_force=false) {
// $return = '';
foreach($param_bindValueArray as $string => $value) {
$param_query = str_replace($string, $value, $param_query);
}
D::li(highlight_string($param_query, true));
D::show($param_bindValueArray, $param_query);
}
private static function new_echo($param_string, $param_print=true, $param_force=false) {
if(trim($param_string)) {
self::$echo_lines[self::$echo_count] = array(
'line' => $param_string,
'print' => $param_print,
'force' => $param_force
);
if($param_force) {
echo 'FORCE:'.mcCONST::TAB.$param_string;
}
self::$echo_count++;
}
}
/**
* Funktion zeigt ein Objekt/Array html strukturiert an
* anstelle von var_dump
*/
public static function show($param_val, $param_string="", $param_print=true, $param_force=false) {
// self::new_echo("<br>______________________<br>", $param_print, $param_force);
self::printCurrentFunction($param_print,"<br>______________________<br>");
// self::new_echo("<b>show(".$param_string.")</b>", $param_print, $param_force);
$string_show = "<b>show(".$param_string.")</b><br />";
if(is_object($param_val) && get_class($param_val)=='DOMElement') {
D::showdomelement($param_val, $string_show.$param_string,$param_print, $param_force);
} else {
if(is_array($param_val)) {
$string_show .= "count(".$param_val.") = ".count($param_val)."";
// self::new_echo("<br/>count(".$param_val.") = ".count($param_val)."", $param_print, $param_force);
}
// self::new_echo("<pre>", $param_print, $param_force);
$string_show .= "<pre>";
self::new_echo($string_show.print_r($param_val, true).'"</pre>"', $param_print, $param_force);
//echo '#############################'.print_r($param_val, true).'####################';
// if(is_object($param_val)) {
// self::new_echo("<b>show(Objekt/Klassen Variablen)</b><pre>", $param_print, $param_force);
// self::new_echo(print_r(get_class_vars(get_class($param_val)), true), $param_print, $param_force);
//
//
//
// self::new_echo("<b>show(Objekt/Klassen Funktionen)</b><pre>", $param_print, $param_force);
// self::new_echo(print_r(get_class_methods($param_val), true), $param_print, $param_force);
// }
// self::new_echo("</pre>", $param_print, $param_force);
// self::new_echo("______________________<br>", $param_print, $param_force);
}
}
/**
* Funktion zeigt html liste
* <li>$param_string</li>
*/
public static function li($param_string, $param_print=true, $param_force=false) {
self::printCurrentFunction($param_print);
self::new_echo("<li>".$param_string."</li>", $param_print, $param_force);
}
public static function kindof($param_kindof, $param_string="", $param_print=true, $param_force=false) {
self::printCurrentFunction($param_print);
self::new_echo("<b>kindof(".$param_string.")</b><pre>", $param_print, $param_force);
if(is_array($param_kindof)) {
$var = 'Array count('.count($param_kindof).')';
} else if(is_object($param_kindof)) {
$var = 'Object('.get_class($param_kindof).') ';
if(is_subclass_of($param_kindof, 'MultimediaText')) {
$var .= ' extends MultimediaText Subject('.$param_kindof->getObjVar('Subject').')';
} else if(get_class($param_kindof)=='MultimediaText') {
$var .= ' Subject('.$param_kindof->getObjVar('Subject').')';
}
} else if(is_int($param_kindof)) {
$var = 'Int('.$param_kindof.')';
} else if(is_bool($param_kindof)) {
$var = 'Bool('.$param_kindof.')';
} else if(is_string($param_kindof)) {
$var = 'String('.$param_kindof.')';
} else {
$var = gettype($param_kindof).'';
}
$var .= ' = ('.$param_kindof.')';
if($param_kindof) {
$var .= ' if('.$param_kindof.' ==> ?true?)';
} else {
$var .= ' else if(!'.$param_kindof.') ==> ?false?';
}
self::new_echo("<li>".$var."</li>", $param_print, $param_force);
}
/**
* Funktion zeigt html unter liste
* <ul><li>$param_string</li></ul>
*/
public static function ulli($param_string, $param_print=true, $param_force=false) {
// self::printCurrentFunction($param_print);
self::new_echo("<ul><li>".$param_string."</li></ul>", $param_print, $param_force);
}
/**
* Funktion zeigt html Überschrift 1 an
* <h1>$param_string</h1>
*/
public static function h1($param_string, $param_print=true, $param_force=false) {
// self::new_echo("<br><br>|------------------------------------------------------<br>", $param_print, $param_force);
// self::backtrace();
self::new_echo("<h1>".$param_string."</h1>", $param_print, $param_force);
}
/**
* Funktion zeigt html Überschrift 2 an
* <h2>$param_string</h2>
*/
public static function h2($param_string, $param_print=true, $param_force=false) {
self::new_echo("<h2>".$param_string."</h2>", $param_print, $param_force);
}
/**
* Funktion zeigt html Überschrift 3 an
* <h3>$param_string</h3>
*/
public static function h3($param_string, $param_print=true, $param_force=false) {
self::new_echo("<h3>".$param_string."</h3>", $param_print, $param_force);
}
/**
* Funktion zeigt html Absatz an
* <p>$param_string</p>
*/
public static function p($param_string, $param_print=true, $param_force=false) {
self::new_echo("<p>".$param_string."</p>", $param_print, $param_force);
}
public static function fe($param_Array, $param_Print=null) {
$param_Print .= 'count('.count($param_Array).') || print '.$param_Array;
D::li($param_Print);
foreach($param_Array as $var_key => $var_value) {
D::ulli($var_key.' => '.$var_value);
}
}
/**
* Funktion gibt den Weg zur tatsächliche Funktion zurück
*
* @static
*/
private static function printCurrentFunction($param_print, $param_string='') {
if($param_print) {
$array = debug_backtrace();
$i=2;
if(is_array($array) && array_key_exists($i,$array)){
// echo 'hello<br><pre>';
// print_r($array[1]);
// echo '</pre>';
$var_depth = 0;
for($v=0; $v<count($array);$v++){
if( array_key_exists('class', $array[$v]) && array_key_exists('class', $array[$i])
&&
$array[$v]['class'].$array[$v]['type'].$array[$v]['function']==$array[$i]['class'].$array[$i]['type'].$array[$i]['function']
){
$var_depth++;
}
// D::ulli($v.': '.$array[$v]['class'].$array[$v]['type'].$array[$v]['function']);
}
self::new_echo($param_string."<p><i style=\"font-size:10;color:gray;\"><b>".$array[$i]["class"].$array[$i]["type"].$array[$i]["function"]."(...)</b> <span title='Rekursionstiefe'>(RT:$var_depth)</span> aufgerufen in Zeile ".$array[$i]["line"]." in Datei <a href=\"".substr($array[$i]["file"],strpos($array[$i]["file"],"httpdocs")+8)."\">".basename($array[$i]["file"])."</a></i> .... [<i style=\"font-size:10;color:gray;\">".$array[$i-1]['class'].$array[$i-1]['type'].$array[$i-1]['function']."(...) aufgerufen in ".basename($array[$i-1]["file"])." Zeile: ".$array[$i-1]["line"]." </i>]</p>");
//echo '___________<pre>';
//echo print_r($array[$i], true);
//echo '</pre>';
}
}
}
public static function backtrace($class=null, $param_print=true, $param_force=false) {
self::printCurrentFunction($param_print);
//echo '<h1>backtrace('.$class.')</h1>';
self::new_echo('<h1>backtrace('.$class.')</h1>', $param_print, $param_force);
$array = debug_backtrace();
$k=0;
for($i=count($array)-1; $i!=0; $i--) {
$k++;
$ul_start="";
$ul_end="";
for($j=0; $j<$k; $j++) {
$ul_start .= "<ul>";
$ul_end .= "</ul>";
}
$var_string = $ul_start."" .
"<li><strong style=\"font-size:8;color:gray;\"><b>" ;
if(array_key_exists('class', $array[$i]) && array_key_exists('type', $array[$i])) {
$var_string .= "".$array[$i]["class"].$array[$i]["type"];
}
$var_string .= $array[$i]["function"]."(...) ";
$var_string .=
"</b> Funktion wird aufgerufen in der Zeile ".$array[$i]["line"]." " .
"in der Datei <a href=\"".substr($array[$i]["file"],strpos($array[$i]["file"],"httpdocs")+8)."\">".basename($array[$i]["file"])."</a>" .
"</strong></li>".$ul_end;
// echo($var_string);
self::new_echo($var_string, $param_print, $param_force);
}
}
/**
*
* @param bool $param_htmltags default false
* @param int $param_start default 1
* @param int $param_end default 0
* @return string
*/
public static function getBacktrace($param_htmltags=false, $param_start=1, $param_end=0) {
if($param_htmltags) {
$htmltag_li_strong_b = '<li><strong style=\"font-size:8;color:gray;\"><b>';
$htmltag_b = '</b>';
$htmltag_strong_li = '</strong></li>';
} else {
$htmltag_li_strong_b = '';
$htmltag_b = '';
$htmltag_strong_li = '';
}
$return_string = '';
$array = debug_backtrace();
$k=0;
$start = count($array)-$param_start;
if($start <= $param_end) {
$param_end = $start-1;
}
for($i=$start; $i!=$param_end; $i--) {
$k++;
$ul_start="";
$ul_end="";
if($param_htmltags) {
for($j=0; $j<$k; $j++) {
$ul_start .= "<ul>";
$ul_end .= "</ul>";
}
$htmltag_start_a = "<a href=\"".substr($array[$i]["file"],strpos($array[$i]["file"],"httpdocs")+8)."\">";
$htmltag_end_a = '</a>';
$tag_endline = '';
} else {
$ul_start="* ";
$htmltag_start_a = '';
$htmltag_end_a = '';
$tag_endline = "\n
".'
';
}
$var_string = $ul_start."" .$htmltag_li_strong_b;
if(array_key_exists('class', $array[$i]) && array_key_exists('type', $array[$i])) {
$var_string .= "".$array[$i]["class"].$array[$i]["type"];
}
$var_string .= $array[$i]["function"]."(...) ";
$var_string .= $htmltag_b." fnc call in row ".$array[$i]["line"]." " .
"in file ".$htmltag_start_a.basename($array[$i]["file"]).$htmltag_end_a .
$htmltag_strong_li.$ul_end.$tag_endline;
$return_string .= $var_string;
}
return $return_string;
}
private static $StartTime;
public static function start() {
self::$StartTime = time();
}
public static function stop($param_startTime=null, $param_string=null, $param_print=true, $param_force=false) {
if($param_startTime==null) {
$param_startTime = self::$StartTime;
}
$zeit = getdate(time() - $param_startTime);
self::new_echo("<li><b>".$param_string."</b> ==>> <b>".$zeit["minutes"]."</b> min <b>".$zeit["seconds"]."</b> sec</li>", $param_print, $param_force);
}
private static function showdomelement($param_XMLElement, $param_string=null,$param_print=true, $param_force=false) {
$count_elements=0;
foreach($param_XMLElement->childNodes as $element) {
if($element->nodeType == 1) {
$string .= 'nodeName: '. $element->nodeName ." | Content: ". $element->textContent . "<br>" ;
$test= $element->nodeName ;
$count_elements++;
}
}
$var_label = $param_XMLElement->getAttribute('label');
if($var_label) {
$string_init = '<br/><b>'.$param_XMLElement->tagName.'</b> label('.$var_label.') ';
}
$string_init .= 'Number of Elements: ' .$count_elements.'<br>';
self::new_echo("$string_init <pre>", $param_print, $param_force);
self::new_echo($string.'</pre>',$param_print, $param_force);
}
public static function showdomdoc($param_XMLElement, $param_string=null,$param_print=true, $param_force=false) {
$count_elements=0;
foreach($param_XMLElement->childNodes as $element) {
if($element->nodeType == 1) {
$string .= 'nodeName: '. $element->nodeName ." | Content: ". $element->textContent . "<br>" ;
$test= $element->nodeName ;
$count_elements++;
}
}
$string .= 'Number of Elements: ' .$count_elements.'<br>';
self::new_echo("<b>showdomdoc(".$param_string.")</b><pre>", $param_print, $param_force);
self::new_echo('</pre>'.$string,$param_print, $param_force);
}
public static function showdomxpath($param_DOMDOC, $param_query,$param_string=null,$param_print=true, $param_force=false) {
$xp = new domxpath($param_DOMDOC);
$titles = $xp->query("/". $param_query ."");
$count_elements=0;
$string = get_class($param_DOMDOC).': => ';
foreach ($titles as $node) {
$string .= '<b> NodeName: </b> <br>'.$node->nodeName .'</b><br><b> NodeContent: </b><br>'.$node->textContent . " <br>";
// $string .= "<br>{$node->previousSibling->previousSibling->previousSibling->previousSibling->previousSibling->previousSibling->previousSibling->previousSibling->nodeValue},<br>";
$count_elements++;
}
$string .= 'Number of Elements: ' .$count_elements.'<br>';
self::new_echo("<b>showdomxpath(".$param_string.")</b><b>query(".'/'.$param_query.")</b><pre>", $param_print, $param_force);
self::new_echo('</pre>'.$string,$param_print, $param_force);
}
/**
* @todo irgendwie muss das anders ....
* alles was mcClasses ist in @see D::showStats und den Rest ganz raus
*
* @global <type> $time_index
* @global <type> $var_ErrorWarnString
* @global <type> $_TREE
*/
public static function showGeneralSoftwareAbstractInfos() {
global $time_index;
global $var_ErrorWarnString;
global $_TREE;
echo '__ <p><br /></p><div class=\'AbstractInfos\'>';
D::stop($time_index, $var_ErrorWarnString.' ### index ('.$_TREE.') komplett mit Temp Ausgabe');
D::p('' .
'TreeManipulator: runTree('.TreeManipulator::$count_runTree.') cb_getBasisClipboard('.TreeManipulator::$count_runTreeCallback_getBasisClipboard.') || runDBTree('.TreeManipulator::$count_runDBTree.') cb_catchInfoboxData('.CatchInfoboxDataTMC::$count_callbackFunction.')<br>' .
'MultimediaText(<b>'.MultimediaText::$counter_____construct.' / '.count(MultimediaText::$MTextArray).'[!!!'.MultimediaText::$DoppeltGeladen.'!!!]</b>) loadObject('.MySql::$count_loadObject.') getObjDOMElement(<b>'.BasisElement::$getObjDOMElement_counter.'</b>['.BasisElement::$getObjDOMElement_counter_diff.']) runTree('.Controller::$count_runTree.')<br>' .
'Mysql(<b>'.BasicMySql::$count___construct.'</b>): query(<b>'.BasicMySql::$MySql_count_query.'</b>/ SR<b>'.BasicMySql::$PDOSRequest_count_query.'</b>) nextRow(<b>'.BasicMySql::$count_nextRow.'</b>) checkAuthorisationQuery(<b>'.Mysql::$count_checkAuthorisationQuery.'</b>)<br> ' .
'getMultimediaTextData('.MySql::$count_getMultimediaTextData.') => getClassNameFromMTextID('.MySql::$count_getClassNameFromMTextID.') => getPrefsBE_SQL_Data('.CONFIG::$count_getSQL_Data.') ==>> Infobox('.Infobox::$count_Infobox.')'.
'CONFIG transformStringToArray('.CONFIG::$count_transformStringToArray.') '.
'');
D::li('geladene MultimediaTexte (index.php)');
$index=1;
foreach(MultimediaText::$MTextArray as $key => $value) {
$index++;
if(!is_array($value->getObjVar('LoadLevel')) || $var_key_LoadLevel = array_keys($value->getObjVar('LoadLevel'))) {
$var_key_LoadLevel = array();
}
if(!is_array($var_key_LoadLevel)) {
$var_key_LoadLevel = array();
}
D::ulli($index.' $key('.$key.') ID('.$value->getObjVar('ID').') Subject('.$value->getObjVar('Subject').') LoadLevel('.Form::arrayToVarchar($var_key_LoadLevel).')');
}
echo '</div>';
}
public static function showStats(array $__mc_Report, $__BASEPATH_EX, $__mc_D_LOGFILE) {
$var_ErrorWarnString = date('d. m. Y G:i:s').': ';
$a_start = '<a href="'.$__mc_D_LOGFILE.'" >';
$a_end = '</a>';
$var_ErrorWarnString .= ' '.$a_start.'D('.count(self::$echo_lines).')'.$a_end.' ';
if(mcNoticeEvent::$count) {
if(array_key_exists('mcNoticeEvent', $__mc_Report) && is_array($__mc_Report['mcNoticeEvent']) && array_key_exists('toFile', $__mc_Report['mcNoticeEvent']) && is_array($__mc_Report['mcNoticeEvent']['toFile'])) {
$a_start = '<a href="'.$__BASEPATH_EX.$__mc_Report['mcNoticeEvent']['toFile']['file'].'" style=\"font-size:15;color:orange;\">';
$a_end = '</a>';
} else {
$a_start = $a_end = '';
}
$var_ErrorWarnString .= ' '.$a_start.'mcNoticeEvent('.mcNoticeEvent::$count.')'.$a_end.' ';
} else {
$var_ErrorWarnString .= ' '.'mcNoticeEvent(0) ';
}
if(Error::$Quantity) {
if(array_key_exists('Error', $__mc_Report) && is_array($__mc_Report['Error']) && array_key_exists('toFile', $__mc_Report['Error']) && is_array($__mc_Report['Error']['toFile'])) {
$a_start = '<a href="'.$__BASEPATH_EX.$__mc_Report['Error']['toFile']['file'].'" style=\"font-size:15;color:red;\">';
$a_end = '</a>';
} else {
$a_start = $a_end = '';
}
$var_ErrorWarnString .= ' '.$a_start. 'Error('.Error::$Quantity.')'.$a_end.' ';
} else {
$var_ErrorWarnString .= ' '.'Error(0) ';
}
if(mcException::$count) {
if(array_key_exists('mcException', $__mc_Report) && is_array($__mc_Report['mcException']) && array_key_exists('toFile', $__mc_Report['mcException']) && is_array($__mc_Report['mcException']['toFile'])) {
$a_start = '<a href="'.$__BASEPATH_EX.$__mc_Report['mcException']['toFile']['file'].'" style=\"font-size:15;color:red;\">';
$a_end = '</a>';
} else {
$a_start = $a_end = '';
}
$var_ErrorWarnString .= ' '.$a_start.'mcException('.mcException::$count.')'.$a_end.' ';
} else {
$var_ErrorWarnString .= ' '.'mcException(0) ';
}
if(mcErrorEvent::$count) {
if(array_key_exists('mcErrorEvent', $__mc_Report) && is_array($__mc_Report['mcErrorEvent']) && array_key_exists('toFile', $__mc_Report['mcErrorEvent']) && is_array($__mc_Report['mcErrorEvent']['toFile'])) {
$a_start = '<a href="'.$__BASEPATH_EX.$__mc_Report['mcErrorEvent']['toFile']['file'].'" style=\"font-size:15;color:red;\">';
$a_end = '</a>';
} else {
$a_start = $a_end = '';
}
$var_ErrorWarnString .= $a_start.'ErrorEvent('.mcErrorEvent::$count.')'.$a_end.' ';
} else {
$var_ErrorWarnString .= 'ErrorEvent(0) ';
}
D::stop(null, $var_ErrorWarnString);
}
}
?>
\ No newline at end of file
<?php
/**
* @filesource class_Error.inc.php
*
* @category losp
* @copyright Copyright by mensch.coop e.G. 2009
* @mailto dev [at] mensch.coop
* @version 0.4.200901
* @link http://mensch.coop
*/
class Error extends mcReport {
public static $ErrorArray = array(
1 => 'E_ERROR',
2 => 'E_WARNING',
4 => 'E_PARSE',
8 => 'E_NOTICE',
16 => 'E_CORE_ERROR',
32 => 'E_CORE_WARNING',
64 => 'E_COMPILE_ERROR',
128 => 'E_COMPILE_WARNING',
256 => 'E_USER_ERROR',
512 => 'E_USER_WARNING',
1024 => 'E_USER_NOTICE',
2048 => 'E_STRICT',
4096 => 'E_RECOVERABLE_ERROR',
) ;
private static $ErrorList;
public static $Quantity=0;
private $ErrorFunction;
/**
* @var string code word for error level
*
* DevError - Error which is for user invisible
* DisplayError - Errir which is for user visible
*/
private $Title;
/**
* @var string code word for errors
*
* NoLoadBE - Error BE cant be load
* NoSaveBE - Error BE cant be save
* NoExistBE - Error BE not exist
* NoLinkBE - Error BE cant be link with others BEs
*/
private $Comment;
private $Code;
private $array_debug_backtrace;
private function __construct($param_title="",$param_comment="", $param_code=""){
$this->array_debug_backtrace = debug_backtrace();
$this->ErrorFunction = $this->array_debug_backtrace[2]["class"].$this->array_debug_backtrace[2]["type"]
.$this->array_debug_backtrace[2]["function"]."(...) :".$this->array_debug_backtrace[1]["line"]."";
$this->Title = $param_title;
$this->Comment = $param_comment;
$this->Code = $param_code;
}
/**
* @todo klar die Parameter definieren, es werden leider immer wieder unterschiedliche Werte übergeben
*
*
* @param <type> $param_title
* @param <type> $param_comment
* @param <type> $param_code
*/
public static function newError($param_title="",$param_comment="", $param_code="") {
global $_LOSP_DEV;
if($_LOSP_DEV) {
D::ulli('<b>'.$param_title.'</b> -- '.$param_comment.' -- '.$param_code);
}
self::$ErrorList[self::$Quantity] = new Error($param_title,$param_comment, $param_code);
mcReport::add(self::$ErrorList[self::$Quantity]);
self::$Quantity++;
}
protected function getTextMessage() {
if(is_null($this->TextMessage)) {
$this->TextMessage .= 'Title:'. mcCONST::TAB. $this->Title. mcCONST::LINEBREAK;
if(array_key_exists($this->Code, Error::$ErrorArray)) {
$this->TextMessage .= 'Typ:'. mcCONST::TAB. Error::$ErrorArray[$this->Code].mcCONST::LINEBREAK;
} else {
$this->TextMessage .= 'Code:'. mcCONST::TAB. $this->Code. mcCONST::LINEBREAK;
}
$this->TextMessage .= 'Notice:'. mcCONST::TAB. $this->Comment. mcCONST::LINEBREAK;
$this->TextMessage .= 'ErrorFnc:'. mcCONST::TAB. $this->ErrorFunction. mcCONST::LINEBREAK;
$this->TextMessage .= mcCONST::LINEBREAK;
}
return $this->TextMessage;
}
/********************************************************************************
* *
* XML Funktionen (Es wird jeweils immer ein DOMElement zurück gegeben)
* *
********************************************************************************/
protected function getDOMElement(DOMDocument $DOMDocument){
$DOMElement = parent::getDOMElement($DOMDocument);
$DOMElement->setAttribute('class', 'error');
$DOMElement->appendChild($DOMDocument->createElement('Function',$this->ErrorFunction));
$DOMElement->appendChild($DOMDocument->createElement('Title',$this->Title));
if($this->Comment) {
$DOMElement->appendChild($DOMDocument->createElement('Comment',$this->Comment));
}
$DOMElement->appendChild($DOMDocument->createElement('Code',$this->Code));
return $DOMElement;
}
public static function getAllXML($DOMDocument){
$DOMElement = $DOMDocument->createElement("ErrorList");
// D::ulli(self::$Quantity.'('.count(self::$ErrorList).'/'.self::$Quantity.'): '.$param_title);
for($i=0; $i<count(self::$ErrorList);$i++){
$DOMElement->appendChild(self::$ErrorList[$i]->getDOMElement($DOMDocument));
}
return $DOMElement;
}
}
?>
\ No newline at end of file
<?php
/**
* @filesource class_Message.inc.php
*
* @category losp
* @copyright Copyright by mensch.coop e.G. 2009
* @mailto dev [at] mensch.coop
* @version 0.4.200901
* @link http://mensch.coop
*/
class Message extends mcReport {
private static $MessageList;
private static $Quantity=0;
private $Kind;
private $ObjectClass;
private $ObjectName;
private function __construct($param_kind="", $param_objectClass="", $param_objectName="", array $param_values = array()){
$this->Kind = $param_kind;
$this->ObjectClass = $param_objectClass;
$this->ObjectName = $param_objectName;
$this->setValues($param_values);
// $this->Values = $param_values;
}
public static function newMessage($param_kind='',$param_objectClass='', $param_objectName='', $param_values = array()) {
self::$MessageList[self::$Quantity] = new Message($param_kind,$param_objectClass, $param_objectName, $param_values);
mcReport::add(self::$MessageList[self::$Quantity]);
self::$Quantity++;
}
protected function getDOMElement(DOMDocument $DOMDocument){
$DOMElement = parent::getDOMElement($DOMDocument);
$DOMElement->setAttribute('kind', $this->Kind);
$DOMElement->setAttribute('classLabel', $this->ObjectClass);
$DOMElement->setAttribute('name', $this->ObjectName);
$DOMElement->setAttribute('label', Language::getMessage($this->Kind, 'label'));
return $DOMElement;
}
public static function getAllXML($DOMDocument){
$DOMElement = $DOMDocument->createElement("MessageList");
for($i=0; $i<count(self::$MessageList);$i++){
$DOMElement->appendChild(self::$MessageList[$i]->getDOMElement($DOMDocument));
}
return $DOMElement;
}
}
?>
\ No newline at end of file
<?
class mcEvent extends mcReport {
/**
* @var int -- errno, contains the level of the error raised
*/
private $errno;
/**
* @var string -- errstr, contains the error message
*/
private $errstr;
/**
* @var string -- errfile, which contains the filename that the error was raised in
*/
private $errfile;
/**
* @var int -- errline, which contains the line number the error was raised at
*/
private $errline;
/**
* @var array -- errcontext, which is an array that points to the active symbol
* table at the point the error occurred. In other words,
* errcontext will contain an array of every variable that
* existed in the scope the error was triggered in. User error
* handler must not modify error context.
*/
private $errcontext;
private $array_debug_backtrace = null;
private $ErrorFunction = null;
protected function __construct($param_errno, $param_errstr, $param_errfile=null, $param_errline=null, $param_errcontext=null) {
$this->errno = $param_errno;
$this->errstr = $param_errstr;
$this->errcontext = $param_errcontext;
$this->array_debug_backtrace = debug_backtrace();
if($param_errfile == null || $param_errline == null) {
$this->ErrorFunction = $this->array_debug_backtrace[2]["class"].$this->array_debug_backtrace[2]["type"]
.$this->array_debug_backtrace[2]["function"]."(...) :".$this->array_debug_backtrace[1]["line"]."";
$this->errfile = $this->array_debug_backtrace[1]['file'];
$this->errline = $this->array_debug_backtrace[1]['line'];
} else {
$this->errfile = $param_errfile;
$this->errline = $param_errline;
}
}
protected function getTextMessage() {
if(is_null($this->TextMessage)) {
$this->TextMessage = self::mkMessage($this->errno, $this->errstr, $this->errfile, $this->errline, $this->errcontext, mcCONST::CODEOFFSET);
}
return $this->TextMessage;
}
private static function mkMessage($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext, $param_offset) {
$var_message = mcCONST::LINEBREAK.'-------------------------------------------------------------'.mcCONST::LINEBREAK;
if(array_key_exists($param_errno, Error::$ErrorArray)) {
$var_message .= 'Typ:'. mcCONST::TAB. Error::$ErrorArray[$param_errno]. mcCONST::TAB. date('d.m.Y G:i').mcCONST::LINEBREAK;
} else {
$var_message .= 'Typ:'. mcCONST::TAB.$param_errno. mcCONST::TAB. date('d. m. Y G:i').mcCONST::LINEBREAK;
}
$var_message .= 'Notice:'. mcCONST::TAB. $param_errstr.mcCONST::LINEBREAK;
$var_message .= 'File:'. mcCONST::TAB. $param_errfile.' (row: '.$param_errline.')'.mcCONST::LINEBREAK;
// $var_message .= 'Url:'. mcCONST::TAB. urldecode(http_build_query($_GET)).mcCONST::LINEBREAK;
// $var_message .= 'PHP: '. mcCONST::TAB. PHP_VERSION . ' (' . PHP_OS . ')'.mcCONST::LINEBREAK;
// $var_message .= mcCONST::LINEBREAK;
$var_message .= self::getCodeFromRow($param_errfile, $param_errline, $param_offset);
$var_message .= mcCONST::LINEBREAK.$param_errcontext.mcCONST::LINEBREAK;
return $var_message;
}
}
class mcNoticeEvent extends mcEvent {
public static $count =0;
public static function handle($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext) {
self::add(new mcNoticeEvent($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext));
mcNoticeEvent::$count++;
}
}
class mcErrorEvent extends mcEvent {
public static $count =0;
public static function handle($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext) {
self::add(new mcErrorEvent($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext));
mcErrorEvent::$count++;
}
}
\ No newline at end of file
<?
/**
* @filesource class_mcReport.inc.php
* @category mcClasses
* @author f@mensch.coop
* @since 2010-12-20
*/
class mcReport {
private static $Stack = array();
protected static function add(mcReport $param_obj) {
if(!array_key_exists(get_class($param_obj), self::$Stack)) {
self::$Stack[get_class($param_obj)] = array();
}
self::$Stack[get_class($param_obj)][] = $param_obj;
}
/**
*
* @param array $param_config
*/
public static function distribute(array $param_config=null) {
if($param_config !== null) {
//D::show($_SERVER);
foreach($param_config as $kindOfReport => $whatToDo) {
if(array_key_exists($kindOfReport, self::$Stack)) {
$GENERAL_TEXT = mcCONST::LINEBREAK.date('d.m.Y G:i:s').mcCONST::LINEBREAK;
$GENERAL_TEXT .= 'File: '.mcCONST::TAB.$_SERVER['SCRIPT_NAME'].mcCONST::LINEBREAK;
if(!empty ($_GET)) {
$GENERAL_TEXT .= 'Url: '.mcCONST::TAB.urldecode(http_build_query($_GET)).mcCONST::LINEBREAK;
}
$GENERAL_TEXT .= 'PHP: '.mcCONST::TAB.PHP_VERSION.' ('.PHP_OS.')'.mcCONST::LINEBREAK;
$GENERAL_TEXT .= 'User: '.mcCONST::TAB.$_SERVER['HTTP_USER_AGENT'].mcCONST::LINEBREAK;
$GENERAL_TEXT .= mcCONST::LINEBREAK;
foreach($whatToDo as $kindOfToDo => $params) {
if($kindOfToDo == 'toScreen' ) {
if(!empty ($params) && array_key_exists('text', $params)) {
self::informUser($params['text']);
}
} else if($kindOfToDo == 'toFile') {
if(array_key_exists('file', $params)) {
$Text = $GENERAL_TEXT;
$Text .= 'KindOf: '.$kindOfReport.' ('.count(self::$Stack[$kindOfReport]).')'.mcCONST::LINEBREAK.mcCONST::LINEBREAK;
$Text .= self::getTextMessageFrom($kindOfReport);
if(array_key_exists('writemode', $params)) {
$writemode = $params['writemode'];
} else {
$writemode = 'a';
}
mcFile::write($params['file'], $Text, $writemode);
}
} else if($kindOfToDo == 'toMail') {
if(array_key_exists('subject', $params)) {
$MailSubject = $params['subject'];
} else {
$MailSubject = '';
}
if(array_key_exists('mail', $params)) {
$MailAdr = $params['mail'];
} else {
break;
}
$MailMessage = $GENERAL_TEXT;
$MailMessage .= self::getTextMessageFrom($kindOfReport);
mcMail::mail($MailAdr, $MailSubject, $MailMessage);
} else {
D::li('kind of mcReport ('.$kindOfToDo.') not supported');
}
}
}
}
}
}
private $Values = array();
protected function setValues(array $param_values) {
$this->Values = $param_values;
}
protected function getDOMElement(DOMDocument $DOMDocument) {
$DOMElement = $DOMDocument->createElement(get_class($this));
foreach($this->Values as $key => $value){
$DOMElement->setAttribute($key,$value);
}
return $DOMElement;
}
private static $TextMessageReports = array();
private static function getTextMessageFrom($param_KindOfReport) {
if(array_key_exists($param_KindOfReport, self::$Stack)) {
if(!array_key_exists($param_KindOfReport, self::$TextMessageReports)) {
self::$TextMessageReports[$param_KindOfReport] = '';
foreach(self::$Stack[$param_KindOfReport] as $mcReportObj) {
self::$TextMessageReports[$param_KindOfReport] .= $mcReportObj->getTextMessage();
}
}
return self::$TextMessageReports[$param_KindOfReport];
} else {
return false;
}
}
protected $TextMessage = null;
protected function getTextMessage() {
if(is_null($this->TextMessage)) {
$this->TextMessage = get_class($this);
}
return $this->TextMessage;
}
protected static function informUser($param_string = null) {
if(is_null($param_string)) {
$param_string = 'leider ist ein Fehler aufgetreten, der Admin wurde informiert, wir hoffen das er bald behoben ist ;) ';
}
/**
* @todo Achtung wie wird genau ein User informiert!!!!
*/
Error::newError('UserError',$param_string,'256');
}
protected static function getCodeFromRow($param_errfile, $param_errline, $param_offset=0) {
$var_result = '';
@$var_file = file($param_errfile);
if($var_file === false) {
$var_result .= 'could not read file'.mcCONST::LINEBREAK;
} else {
if(count($var_file) < $param_errline) {
$var_result .= 'row not in the file'.mcCONST::LINEBREAK;
} else {
if($param_errline-$param_offset < 0) {
$var_StartCode = 0;
} else {
$var_StartCode = $param_errline - $param_offset ;
}
$var_EndCode = $param_errline + $param_offset;
$var_result .= mcCONST::LINEBREAK.'<php>'.mcCONST::LINEBREAK;
for($i=$var_StartCode; $i < count($var_file);$i++) {
if($i > $var_EndCode) {
break;
}
if($i == $param_errline) {
$var_marker = ' => ';
} else {
$var_marker = ' ';
}
if($i-1 >=0) {
$var_result .= $i.$var_marker.mcCONST::TAB.$var_file[$i-1];
}
}
$var_result .= '</php>';
}
}
return $var_result;
}
}
?>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<XMI verified="false" xmi.version="1.2" timestamp="2010-12-20T22:24:20" xmlns:UML="http://schema.omg.org/spec/UML/1.3">
<XMI.header>
<XMI.documentation>
<XMI.exporter>umbrello uml modeller http://uml.sf.net</XMI.exporter>
<XMI.exporterVersion>1.5.8</XMI.exporterVersion>
<XMI.exporterEncoding>UnicodeUTF8</XMI.exporterEncoding>
</XMI.documentation>
<XMI.metamodel xmi.version="1.3" href="UML.xml" xmi.name="UML"/>
</XMI.header>
<XMI.content>
<UML:Model isSpecification="false" isAbstract="false" isLeaf="false" xmi.id="m1" isRoot="false" name="UML-Modell">
<UML:Namespace.ownedElement>
<UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="folder" name="folder"/>
<UML:Stereotype visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="datatype" name="datatype"/>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Logical View" name="Logical View">
<UML:Namespace.ownedElement>
<UML:Package stereotype="folder" visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Datatypes" name="Datatypes">
<UML:Namespace.ownedElement>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="9dmndmCZqwfM" name="int"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="L9P3AbESGokK" name="char"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="p4nZ9wCvknhu" name="bool"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="2q0LAAkDILRk" name="float"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="bEUt3WgafdlY" name="double"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="LYDFvj3wY4Fi" name="short"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="CzvSIKCuYela" name="long"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="8SAn3vJOUWbN" name="unsigned int"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="GeHmgWUqTPIm" name="unsigned short"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="jUeI6PqEr0zu" name="unsigned long"/>
<UML:DataType stereotype="datatype" visibility="public" isSpecification="false" namespace="Datatypes" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="uIGOppj3Szp8" name="string"/>
</UML:Namespace.ownedElement>
</UML:Package>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="oFCqi9ROJ1By" name="mcError">
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="wprAjRsCZyNa"/>
</UML:GeneralizableElement.generalization>
<UML:Classifier.feature>
<UML:Operation visibility="public" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" ownerScope="classifier" isRoot="false" xmi.id="38iavxgOCiqo" name="newError"/>
</UML:Classifier.feature>
</UML:Class>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="T0D8WwSHFslE" name="mcMessage">
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="dBLC7hkm4A13"/>
</UML:GeneralizableElement.generalization>
<UML:Classifier.feature>
<UML:Operation visibility="public" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" ownerScope="classifier" isRoot="false" xmi.id="WhUNQrsfmMgP" name="newMessage"/>
</UML:Classifier.feature>
</UML:Class>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="g3myTW4RHVFO" name="neue_klasse">
<UML:Classifier.feature>
<UML:Operation visibility="public" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="jiUlJBERv6l7" name="__construct"/>
</UML:Classifier.feature>
</UML:Class>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="0317CJzBMatu" name="mcReport">
<UML:Classifier.feature>
<UML:Attribute visibility="private" isSpecification="false" ownerScope="classifier" xmi.id="p9wsa7j57PtP" type="Syys7YWEMYvF" name="Stack"/>
<UML:Operation visibility="public" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="vseRGG2Pyp3t" name="__construct"/>
<UML:Operation visibility="public" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" ownerScope="classifier" isRoot="false" xmi.id="sTtDFi82zLah" name="new"/>
<UML:Operation visibility="protected" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="9NdPOdIl2YLA" name="getDOMElement"/>
<UML:Operation visibility="protected" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="CoBXPPQMllcF" name="setValues"/>
<UML:Operation visibility="protected" isSpecification="false" isQuery="false" isAbstract="false" isLeaf="false" ownerScope="classifier" isRoot="false" xmi.id="lM1WBTzTgbd6" name="add"/>
</UML:Classifier.feature>
</UML:Class>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Syys7YWEMYvF" name="array"/>
<UML:Generalization discriminator="" visibility="public" isSpecification="false" namespace="Logical View" child="oFCqi9ROJ1By" xmi.id="wprAjRsCZyNa" parent="0317CJzBMatu" name=""/>
<UML:Generalization discriminator="" visibility="public" isSpecification="false" namespace="Logical View" child="T0D8WwSHFslE" xmi.id="dBLC7hkm4A13" parent="0317CJzBMatu" name=""/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Fb0UIXEcRHPd" name="mcEvent">
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="C0jUYy6xDTaE"/>
</UML:GeneralizableElement.generalization>
</UML:Class>
<UML:Generalization discriminator="" visibility="public" isSpecification="false" namespace="Logical View" child="Fb0UIXEcRHPd" xmi.id="C0jUYy6xDTaE" parent="0317CJzBMatu" name=""/>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="3HhLrU6jdQxr" name="mcNoticeEvent">
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="mlPZIvIhs0Bo"/>
</UML:GeneralizableElement.generalization>
</UML:Class>
<UML:Class visibility="public" isSpecification="false" namespace="Logical View" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="3S5dACmBTSUK" name="mcErrorEvent">
<UML:GeneralizableElement.generalization>
<UML:Generalization xmi.idref="xZVnZhZaIQD4"/>
</UML:GeneralizableElement.generalization>
</UML:Class>
<UML:Generalization discriminator="" visibility="public" isSpecification="false" namespace="Logical View" child="3HhLrU6jdQxr" xmi.id="mlPZIvIhs0Bo" parent="Fb0UIXEcRHPd" name=""/>
<UML:Generalization discriminator="" visibility="public" isSpecification="false" namespace="Logical View" child="3S5dACmBTSUK" xmi.id="xZVnZhZaIQD4" parent="Fb0UIXEcRHPd" name=""/>
</UML:Namespace.ownedElement>
<XMI.extension xmi.extender="umbrello">
<diagrams>
<diagram showopsig="1" linecolor="#ff0000" snapx="10" showattribassocs="1" snapy="10" linewidth="0" showattsig="1" showpubliconly="0" showpackage="1" showstereotype="1" name="Klassendiagramm" font="DejaVu Sans,9,-1,0,50,0,0,0,0,0" canvasheight="542" canvaswidth="1137" localid="" snapcsgrid="0" showgrid="0" showops="1" usefillcolor="1" fillcolor="#ffff00" zoom="100" xmi.id="m3ASJSS0PP2R" documentation="" showscope="1" snapgrid="0" showatts="1" type="1">
<widgets>
<classwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" showoperations="1" usesdiagramusefillcolor="0" showpubliconly="0" showpackage="1" x="322" showattsigs="601" showstereotype="1" y="147" showattributes="1" font="DejaVu Sans,9,-1,0,75,0,0,0,0,0" width="90" isinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="oFCqi9ROJ1By" showscope="1" height="35" showopsigs="601"/>
<classwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" showoperations="1" usesdiagramusefillcolor="0" showpubliconly="0" showpackage="1" x="462" showattsigs="601" showstereotype="1" y="237" showattributes="1" font="DejaVu Sans,9,-1,0,75,0,0,0,0,0" width="115" isinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="T0D8WwSHFslE" showscope="1" height="35" showopsigs="601"/>
<classwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" showoperations="1" usesdiagramusefillcolor="0" showpubliconly="0" showpackage="1" x="455" showattsigs="601" showstereotype="1" y="23" showattributes="1" font="DejaVu Sans,9,-1,5,75,0,0,0,0,0" width="134" isinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="0317CJzBMatu" showscope="1" height="98" showopsigs="601"/>
<classwidget linecolor="#ff0000" usesdiagramfillcolor="0" linewidth="none" showoperations="1" usesdiagramusefillcolor="0" showpubliconly="0" showpackage="1" x="664" showattsigs="601" showstereotype="1" y="156" showattributes="1" font="DejaVu Sans,9,-1,5,75,0,0,0,0,0" width="68" isinstance="0" usefillcolor="1" fillcolor="#ffff00" xmi.id="Fb0UIXEcRHPd" showscope="1" height="28" showopsigs="601"/>
<classwidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" showoperations="1" usesdiagramusefillcolor="1" showpubliconly="0" showpackage="1" x="670" showattsigs="601" showstereotype="1" y="265" showattributes="1" font="DejaVu Sans,9,-1,0,75,0,0,0,0,0" width="113" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="3HhLrU6jdQxr" showscope="1" height="28" showopsigs="601"/>
<classwidget linecolor="none" usesdiagramfillcolor="1" linewidth="none" showoperations="1" usesdiagramusefillcolor="1" showpubliconly="0" showpackage="1" x="829" showattsigs="601" showstereotype="1" y="249" showattributes="1" font="DejaVu Sans,9,-1,0,75,0,0,0,0,0" width="103" isinstance="0" usefillcolor="1" fillcolor="none" xmi.id="3S5dACmBTSUK" showscope="1" height="28" showopsigs="601"/>
</widgets>
<messages/>
<associations>
<assocwidget indexa="1" indexb="1" widgetaid="oFCqi9ROJ1By" linecolor="none" totalcounta="2" xmi.id="wprAjRsCZyNa" widgetbid="0317CJzBMatu" totalcountb="2" type="500" linewidth="none">
<linepath>
<startpoint startx="412" starty="147"/>
<endpoint endx="455" endy="121"/>
</linepath>
</assocwidget>
<assocwidget indexa="1" indexb="1" widgetaid="T0D8WwSHFslE" linecolor="none" totalcounta="2" xmi.id="dBLC7hkm4A13" widgetbid="0317CJzBMatu" totalcountb="2" type="500" linewidth="none">
<linepath>
<startpoint startx="522" starty="237"/>
<endpoint endx="522" endy="121"/>
</linepath>
</assocwidget>
<assocwidget indexa="1" indexb="1" widgetaid="Fb0UIXEcRHPd" linecolor="none" totalcounta="2" xmi.id="C0jUYy6xDTaE" widgetbid="0317CJzBMatu" totalcountb="2" type="500" linewidth="none">
<linepath>
<startpoint startx="664" starty="156"/>
<endpoint endx="589" endy="121"/>
</linepath>
</assocwidget>
<assocwidget indexa="1" indexb="1" widgetaid="3HhLrU6jdQxr" linecolor="none" totalcounta="2" xmi.id="mlPZIvIhs0Bo" widgetbid="Fb0UIXEcRHPd" totalcountb="3" type="500" linewidth="none">
<linepath>
<startpoint startx="670" starty="265"/>
<endpoint endx="670" endy="184"/>
</linepath>
</assocwidget>
<assocwidget indexa="1" indexb="2" widgetaid="3S5dACmBTSUK" linecolor="none" totalcounta="2" xmi.id="xZVnZhZaIQD4" widgetbid="Fb0UIXEcRHPd" totalcountb="3" type="500" linewidth="none">
<linepath>
<startpoint startx="829" starty="249"/>
<endpoint endx="732" endy="184"/>
</linepath>
</assocwidget>
</associations>
</diagram>
</diagrams>
</XMI.extension>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Use Case View" name="Use Case View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Component View" name="Component View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Deployment View" name="Deployment View">
<UML:Namespace.ownedElement/>
</UML:Model>
<UML:Model stereotype="folder" visibility="public" isSpecification="false" namespace="m1" isAbstract="false" isLeaf="false" isRoot="false" xmi.id="Entity Relationship Model" name="Entity Relationship Model">
<UML:Namespace.ownedElement/>
</UML:Model>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
<XMI.extensions xmi.extender="umbrello">
<docsettings viewid="m3ASJSS0PP2R" uniqueid="R13z3MoyvJlS" documentation=""/>
<listview>
<listitem open="1" type="800" id="Views">
<listitem open="1" type="801" id="Logical View">
<listitem open="0" type="807" id="m3ASJSS0PP2R" label="Klassendiagramm"/>
<listitem open="1" type="813" id="Syys7YWEMYvF"/>
<listitem open="1" type="813" id="oFCqi9ROJ1By">
<listitem open="0" type="815" id="38iavxgOCiqo"/>
</listitem>
<listitem open="1" type="813" id="3S5dACmBTSUK"/>
<listitem open="1" type="813" id="Fb0UIXEcRHPd"/>
<listitem open="1" type="813" id="T0D8WwSHFslE">
<listitem open="0" type="815" id="WhUNQrsfmMgP"/>
</listitem>
<listitem open="1" type="813" id="3HhLrU6jdQxr"/>
<listitem open="1" type="813" id="0317CJzBMatu">
<listitem open="0" type="814" id="p9wsa7j57PtP"/>
<listitem open="0" type="815" id="sTtDFi82zLah"/>
<listitem open="0" type="815" id="vseRGG2Pyp3t"/>
<listitem open="0" type="815" id="9NdPOdIl2YLA"/>
<listitem open="0" type="815" id="CoBXPPQMllcF"/>
<listitem open="0" type="815" id="lM1WBTzTgbd6"/>
</listitem>
<listitem open="1" type="813" id="g3myTW4RHVFO">
<listitem open="0" type="815" id="jiUlJBERv6l7"/>
</listitem>
<listitem open="0" type="830" id="Datatypes">
<listitem open="1" type="829" id="p4nZ9wCvknhu"/>
<listitem open="1" type="829" id="L9P3AbESGokK"/>
<listitem open="1" type="829" id="bEUt3WgafdlY"/>
<listitem open="1" type="829" id="2q0LAAkDILRk"/>
<listitem open="1" type="829" id="9dmndmCZqwfM"/>
<listitem open="1" type="829" id="CzvSIKCuYela"/>
<listitem open="1" type="829" id="LYDFvj3wY4Fi"/>
<listitem open="1" type="829" id="uIGOppj3Szp8"/>
<listitem open="1" type="829" id="8SAn3vJOUWbN"/>
<listitem open="1" type="829" id="jUeI6PqEr0zu"/>
<listitem open="1" type="829" id="GeHmgWUqTPIm"/>
</listitem>
</listitem>
<listitem open="1" type="802" id="Use Case View"/>
<listitem open="1" type="821" id="Component View"/>
<listitem open="1" type="827" id="Deployment View"/>
<listitem open="1" type="836" id="Entity Relationship Model"/>
</listitem>
</listview>
<codegeneration>
<codegenerator language="C++"/>
</codegeneration>
</XMI.extensions>
</XMI>
<?
/**
* @filesource fnc_mcErrorHandler.inc.php
*
* @category losp
* @copyright Copyright by mensch.coop e.G. 2009
* @mailto dev [at] mensch.coop
* @version 0.4.200901
* @link http://mensch.coop
*/
function mcErrorHandler($param_typ, $param_notice, $param_file, $param_row, $param_More) {
switch ($param_typ) {
case E_ERROR: // 1
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
die();
break;
case E_WARNING: // 2
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_PARSE: // 4
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_NOTICE: // 8
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_CORE_ERROR: // 16
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_CORE_WARNING: // 32
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_COMPILE_ERROR: // 64
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_COMPILE_WARNING: // 128
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_USER_ERROR: // 256
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_USER_WARNING: // 512
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_USER_NOTICE: // 1024 since PHP 4
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_STRICT: // 2048 since PHP 5
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_RECOVERABLE_ERROR : // 4096 since PHP 5.2.0
mcErrorEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_DEPRECATED: // 8192 since PHP 5.3.0
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_USER_DEPRECATED: // 16384 since PHP 5.3.0
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
case E_ALL: // 30719 in PHP 5.3.x, 6143 in PHP 5.2.x, 2047 previously
mcNoticeEvent::handle($param_typ, $param_notice, $param_file, $param_row, $param_More);
break;
default:
D::li('___Typ: '.$param_typ.' (E_NOTICE = '.E_NOTICE.' E_WARNING = '.E_WARNING.' E_ERROR = '.E_ERROR.') <b>[anscheinend ein neuer Typ .. da muss doch gleich mal auf der <a href="http://php.net/manual/en/errorfunc.constants.php">Predefined Constants</a> seite nachgeschaut werden]</b>');
D::ulli('Notiz: '.$param_notice);
D::ulli('Datei: '.$param_file);
D::ulli('Zeile: '.$param_row);
}
// return FALSE;
}
?>
\ No newline at end of file
<?php
/**
* @var link to the basic path from the mcClasses dir
*/
$__BASEPATH_EX='../../../';
/**
* @var link from the basic path to the mcClasses dir,
* copy this var in the main basepath.inc.php if you want use include.php
*/
$__PATH_to_mcClasses= $__BASEPATH_EX .'include/Lib/Tools/mcClasses/';
?>
\ No newline at end of file
<?php
class mcCONST {
/**
* @var constant -- old ::$zeilenumbruch
*/
const LINEBREAK = '
';
/**
* @var constant -- old ::$tab
*/
const TAB = ' ';
/**
* @var int Anzahl der Zeilen die vor und nach der Warnung mit ausgegeben werden soll
*/
const CODEOFFSET = 3;
/**
* arrays gehen leider noch nicht als CONSTante
* @var array
*/
public static $HTMLTAGS2TEXT = array(
'<i style="font-size:10;color:gray;">' => '[',
'<i>' => '[',
'</i>' => ']',
"<li>" => "* ",
"</li>" => "",
"<ul>" => "\t",
"</ul>" => "",
"<p>" => "\n",
"</p>" => "\n",
"<b>" => " __",
"</b>" => "__ ",
"<span title='Rekursionstiefe'>" => "",
"</span>" => "",
'<h2>' => "\n______________________________\n",
'</h2>' => "\n##############################\n",
'<h1>' => "\n______________________________\n",
'</h1>' => "\n##############################\n##############################\n",
'<pre>' => "",
'</pre>' => "",
'<br>' => "\n",
'<br/>' => "\n",
'<br />' => "\n",
);
}
?>
<?php
class mcCsv {
public static function exportCsv($param_xml,$param_name){
$cut_Array=explode('CUT_VALUE_FOR_NOT_THE_HEADER',$param_xml);
//file_name
$var_filename = 'export_'.$param_name.'.csv';
// Header senden
header("Content-Disposition: attachment; filename =".$var_filename);
header("Content-Type: text/plain");
// Datei ausgeben
echo trim($cut_Array[1]);
}
}
?>
\ No newline at end of file
<?php
/**
*
*/
class mcDeprecated {
public static function is($param_deprecated) {
global $__mc_DEPRECATED;
global $__mc_DEPRECATED_OUTPUT;
if($__mc_DEPRECATED < $param_deprecated) {
if($__mc_DEPRECATED_OUTPUT) {
D::li('software runs which is @deprecated since '. substr($param_deprecated, 0,4).'-'. substr($param_deprecated, 4,2).'-'. substr($param_deprecated, 6,2).' v('. substr($__mc_DEPRECATED, 0,4).'-'. substr($__mc_DEPRECATED, 4,2).'-'. substr($__mc_DEPRECATED, 6,2).')');
}
return true;
} else {
return false;
}
}
}
?>
\ No newline at end of file
<?
class mcException extends mcEvent {
public static function handleException (Exception $e) {
// D::h2('Exception Error ('.$e->getCode().') in '.$e->getFile().' in row '.$e->getLine());
// D::e('Message: '.$e->getMessage().' '. c.'<br>');
// D::show($e->getTraceAsString(), 'TraceAsString');
// if($e->getPrevious()) {
// D::e('there is a previous exception');
// }
if(get_class($e) == 'PDOException') {
foreach($e->getTrace() as $i => $array) {
// D::li($i);
if(array_key_exists('args', $array)) {
$out1 = null;
foreach($array['args'] as $arg) {
if(get_class ($arg) == 'PDOStatement') {
ob_start();
$arg->debugDumpParams();
$out1 = ob_get_contents();
ob_end_clean();
// D::ulli($out1);
break;
}
}
if($out1) {
break;
}
}
}
}
self::handle(E_ERROR, $e->getCode(), $e->getFile(), $e->getLine(), $e->getMessage().mcCONST::LINEBREAK.$out1);
return false;
}
public static $count =0;
private static function handle($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext) {
self::add(new mcException($param_errno, $param_errstr, $param_errfile, $param_errline, $param_errcontext));
self::$count++;
}
}
?>
\ No newline at end of file
<?
class mcFile {
/**
*
*
* @param string $param_filename
* @param string $param_text
* @param string $param_kindof -- r|r+|w|w+|a|a+ @see http://de3.php.net/manual/de/function.fopen.php
* r - ptr at the beginning
* w - ptr at the beginning and file size 0
* a - ptr at the end
* @return bool
*/
public static function write($param_filename, $param_text, $param_kindof = null) {
if($param_filename && $param_text) {
if($param_kindof === null) {
$param_kindof = 'a';
}
try {
@$var_file = fopen($param_filename,$param_kindof);
if ($var_file === false) {
return false;
} else {
fputs($var_file, $param_text);
fputs($var_file, mcCONST::LINEBREAK.mcCONST::LINEBREAK);
}
fclose($var_file);
return true;
} catch (Exception $e) {
mcException::handleException($e);
}
} else {
return false;
}
}
}
?>
<?
class mcMail {
// private static $tab = ' ';
private static $CollectionForMailToAdmin = array();
public static function collectForMailToAdmin($param_to, $param_subject, $param_message, $param_logfile=null) {
if(!array_key_exists($param_to, self::$CollectionForMailToAdmin)) {
self::$CollectionForMailToAdmin[$param_to] = array();
}
self::$CollectionForMailToAdmin[$param_to][] = array(
'subject' => $param_subject,
'message' => $param_message
);
// mail($param_to, $param_subject, $param_message);
}
public static function mail($param_to, $param_subject, $param_message) {
mail($param_to, $param_subject, $param_message);
}
public static function mailToAdmin() {
foreach(self::$CollectionForMailToAdmin as $to => $array_message) {
$subject = false;
if(empty ($_GET)) {
$message = false;
} else {
$message = mcCONST::LINEBREAK.'Url: '.urldecode(http_build_query($_GET)).mcCONST::LINEBREAK;
}
$message .= 'PHP: '. mcCONST::TAB. PHP_VERSION . ' (' . PHP_OS . ')'.mcCONST::LINEBREAK.mcCONST::LINEBREAK;
if(is_array($array_message)) {
foreach($array_message as $var_message) {
if($subject===false) {
$subject = $var_message['subject'].' ';
} else {
$subject .= '.';
}
$message .= mcCONST::LINEBREAK.mcCONST::LINEBREAK
.$var_message['subject'].mcCONST::LINEBREAK
. $var_message['message'].mcCONST::LINEBREAK;
}
self::mail($to, $subject, $message);
}
}
}
}
?>
\ No newline at end of file
<?
class mcPerformance {
private static $StaticCalls = array();
private static function prepareStaticCalls($param_ClassName, $param_FncName, array $param_toDiffParams=array()) {
if(!array_key_exists($param_ClassName, mcPerformance::$StaticCalls)) {
mcPerformance::$StaticCalls[$param_ClassName] = array();
}
if(!array_key_exists($param_FncName, mcPerformance::$StaticCalls[$param_ClassName])) {
mcPerformance::$StaticCalls[$param_ClassName][$param_FncName] = array( );
}
global $__mcPerformance_backtrace;
if($__mcPerformance_backtrace) {
$string_backtrace = D::getBacktrace($param_htmltags=false, $param_start=2, $param_end=2);
} else {
$string_backtrace = '__mcPerformance_backtrace = false';
}
$toDiffParams = serialize($param_toDiffParams);
$obj_key = null;
$count_objects = count(mcPerformance::$StaticCalls[$param_ClassName][$param_FncName]);
for($i=0; $i<$count_objects; $i++ ) {
if(mcPerformance::$StaticCalls[$param_ClassName][$param_FncName][$i]['param'] === $toDiffParams) {
$obj_key = $i;
}
}
if(is_null($obj_key)) {
mcPerformance::$StaticCalls[$param_ClassName][$param_FncName][] = array('count'=>1, 'param' => $toDiffParams, 'backtraceStrings' => array($string_backtrace));
} else {
mcPerformance::$StaticCalls[$param_ClassName][$param_FncName][$obj_key]['count']++;
mcPerformance::$StaticCalls[$param_ClassName][$param_FncName][$obj_key]['backtraceStrings'][] = $string_backtrace;
}
}
private static $ObjectCalls = array();
private static function prepareObjectCalls($param_ClassName, $param_FncName, &$param_Object, array $param_toDiffParams=array()) {
if(!array_key_exists($param_ClassName, mcPerformance::$ObjectCalls)) {
mcPerformance::$ObjectCalls[$param_ClassName] = array();
}
if(!array_key_exists($param_FncName, mcPerformance::$ObjectCalls[$param_ClassName])) {
mcPerformance::$ObjectCalls[$param_ClassName][$param_FncName] = array( );
}
global $__mcPerformance_backtrace;
if($__mcPerformance_backtrace) {
$string_backtrace = D::getBacktrace($param_htmltags=false, $param_start=2, $param_end=2);
} else {
$string_backtrace ='__mcPerformance_backtrace = false';
}
if(array_search('getID', get_class_methods($param_ClassName))) {
$getIDFnc = true;
if(!array_key_exists($param_Object->getID(), mcPerformance::$ObjectCalls[$param_ClassName][$param_FncName])) {
mcPerformance::$ObjectCalls[$param_ClassName][$param_FncName][$param_Object->getID()] = array( );
}
$ObjArray = &mcPerformance::$ObjectCalls[$param_ClassName][$param_FncName][$param_Object->getID()];
} else {
$getIDFnc = false;
$ObjArray = &mcPerformance::$ObjectCalls[$param_ClassName][$param_FncName];
}
$toDiffParams = serialize($param_toDiffParams);
$obj_key = null;
$count_objects = count($ObjArray);
for($i=0; $i<$count_objects; $i++ ) {
if($param_Object === $ObjArray[$i]['object'] && $ObjArray[$i]['param'] === $toDiffParams) {
$obj_key = $i;
}
}
if(is_null($obj_key)) {
$ObjArray[] = array('count'=>1, 'object' => &$param_Object, 'param' => $toDiffParams, 'backtraceStrings' => array($string_backtrace));
} else {
$ObjArray[$obj_key]['count']++;
$ObjArray[$obj_key]['backtraceStrings'][] = $string_backtrace;
}
}
/**
* erstellt eine kleine Statistik über die Funktion in der checkMultipleCalls() aufgerufen wird
* Statistik kann über mcPerformance::showStats() angezeigt werden
*
* @param array $param_toDiffParams default array() --- wenn gesetzt, unterscheidet fnc auch nach Parametern
*/
public static function checkMultipleCalls(array $param_toDiffParams=array()) {
global $_LOSP_DEV;
if($_LOSP_DEV) {
$array_backtrace = debug_backtrace();
/**
* static class function call
*/
if($array_backtrace[1]['type'] == '::') {
mcPerformance::prepareStaticCalls($array_backtrace[1]['class'], $array_backtrace[1]['function'], $param_toDiffParams);
/**
* object function call
*/
} else if($array_backtrace[1]['type'] == '->') {
mcPerformance::prepareObjectCalls($array_backtrace[1]['class'], $array_backtrace[1]['function'], $array_backtrace[1]['object'], $param_toDiffParams);
} else {
D::li('type ('.$array_backtrace[1]['type'].') not implemantated');
}
}
}
public static function showStats() {
global $_LOSP_DEV;
if($_LOSP_DEV) {
D::h1('static calls');
foreach(mcPerformance::$StaticCalls as $classname => $fnc) {
D::li('<b>'.$classname.'</b>');
foreach($fnc as $fncname => $FncCalls) {
D::ulli('<b>'.$fncname.' with '.count($FncCalls).' different fnc calls </b>');
$allFncCalls = 0;
foreach($FncCalls as $FncCall) {
$backtraceString = '';
foreach($FncCall['backtraceStrings'] as $index => $string_backtrace) {
if($index==0) {
$backtraceString .= '<i title="'.$string_backtrace.'">'.$index.'</i> ';
} else {
$backtraceString .= '- <b><i title="'.$string_backtrace.'">'.$index.'</i></b> ';
}
}
$string_param = str_replace('"', '', $FncCall['param']);
if(strlen($string_param) < 32) {
$string4param = " ".$string_param." ";
} else {
$string4param = ' <u title="'.$string_param.'">'.md5($FncCall['param'])."</u> ";
}
D::ulli('<i>'.$fncname.'('.$string4param.') wurde '.$FncCall['count'].' aufgerufen</i>'.' backtrace '.$backtraceString);
$allFncCalls += $FncCall['count'];
}
D::ulli('<b>'.$fncname.' general: '.$allFncCalls.' </b>');
}
}
D::h1('object calls');
foreach(mcPerformance::$ObjectCalls as $classname => $fnc) {
if(array_search('getID', get_class_methods($classname))) {
$getIDFnc = true;
} else {
$getIDFnc = false;
}
D::li('<b>'.$classname.'</b>');
foreach($fnc as $fncname => $objects) {
if($getIDFnc) {
D::ulli('<b>'.$fncname.' mit '.count($objects).' unterschiedlichen objects </b>');
foreach($objects as $objID => $objIDArray) {
D::ulli('<b><i>'.$objID.' => wurde '.count($objIDArray).' geladen</i></b>');
foreach($objIDArray as $obj) {
if(strlen($obj['param']) < 32) {
$string4param = "\t Param(".$obj['param'].")";
} else {
$string4param = "\t Param_md5(".md5($obj['param']).")";
}
$backtraceString = '';
foreach($obj['backtraceStrings'] as $index => $string_backtrace) {
if($index==0) {
$backtraceString .= '<i title="'.$string_backtrace.'">'.$index.'</i> ';
} else {
$backtraceString .= '- <b><i title="'.$string_backtrace.'">'.$index.'</i></b> ';
}
}
D::ulli($obj['object'].' => '.$obj['count'].' x '.$fncname. $string4param.' backtrace '.$backtraceString);
}
}
} else {
D::ulli('<b>'.$fncname.' mit '.count($objects).' objects</b>');
foreach($objects as $obj) {
$string_param = str_replace('"', '', $obj['param']);
if(strlen($string_param) < 32) {
$string4param = "\t Param(".$string_param.")";
} else {
$string4param = ' <i title="'.$string_param.'">Param_md5('.md5($obj['param']).")</i>";
}
$backtraceString = '';
foreach($obj['backtraceStrings'] as $index => $string_backtrace) {
if($index==0) {
$backtraceString .= '<i title="'.$string_backtrace.'">'.$index.'</i> ';
} else {
$backtraceString .= '- <b><i title="'.$string_backtrace.'">'.$index.'</i></b> ';
}
}
D::ulli($obj['object'].' => '.$obj['count'].' x '.$fncname. $string4param.' backtrace '.$backtraceString);
}
}
}
}
}
}
}
?>
<?php
// $__PATH_to_mcClasses;
if(!isset($_LOSP_DEV)) {
/**
* @var boolean -- activate the dev modus
*/
$_LOSP_DEV = true;
}
if(!isset($__mc_D_LOGFILE)) {
/**
* @todo @since 20110325 die vars müssen eigentlich hier aus __mc raus ... da sie freeSN abhängig sind @author f@mensch.coop
*/
if(isset($_TREE) && $_TREE) {
$string = $_TREE;
} else if(isset($_PAGE_NAME) && $_PAGE_NAME) {
$string = $_PAGE_NAME;
} else {
$string = 'no';
}
/**
* @var string -- file for the D Output
*/
$__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_D.log';
}
if(!isset($__mc_D_SCREENOUTPUT)) {
/**
* @var boolean -- activate the D Output on screen
*/
$__mc_D_SCREENOUTPUT = false;
}
if(!isset($__mcPerformance_backtrace)) {
/**
* @var boolean -- activate the D Output on screen
*/
$__mcPerformance_backtrace = true;
}
if(!isset($__mc_ERRORHANDLER)) {
/**
* @var boolean -- is true use the mcErrorHandler
*/
$__mc_ERRORHANDLER = true;
}
if(!isset($__mc_DEPRECATED)) {
/**
* @var int
* if you want @deprecated functions since a date (format: yyyymmdd)
*/
$__mc_DEPRECATED = 20110201;
}
if(!isset($__mc_Report)) {
/**
* @var array -- configuration of the report (mcNoticeEvent, mcErrorEvent, Error)
*/
$__mc_Report = array(
'mcNoticeEvent' => array(
'toScreen' => array(),
'toFile' => array('file' => 'log/NoticeEvent.log')
),
'mcErrorEvent' => array(
'toScreen' => array(),
'toFile' => array(
'file' => 'log/ErrorEvent.log',
'writemode' => 'a',
'reset' => false,
),
// 'toMail' => array(
// 'mail' => 'mail@localhost.tld',
// 'subject' => 'Error:'
// )
),
'mcException' => array(
'toScreen' => array(),
'toFile' => array(
'file' => 'log/Exception.log',
'writemode' => 'a',
'reset' => false,
),
// 'toMail' => array(
// 'mail' => 'mail@localhost.tld',
// 'subject' => 'Error:'
// )
),
'Error' => array(
'toScreen' => array('text' => 'ERROR Error ERROR Error ERROR'),
'toFile' => array(
'file' => 'log/Error.config.log',
'writemode' => 'a',
'reset' => false,
),
// 'toMail' => array(
// 'mail' => 'mail@localhost.tld',
// 'subject' => 'Error:'
// )
),
);
}
?>
\ No newline at end of file
<?
/**
* dinge die am Ende noch ausgeführt werden sollen
*
* (nur für Dinge die unter mcClasses sind)
*
* @author f@mensch.coop @since 2010-12-01
*/
mcReport::distribute($__mc_Report);
/**
* developer things
*/
if($_LOSP_DEV) {
D::showStats($__mc_Report, $__BASEPATH_EX, $__mc_D_LOGFILE);
if($__mc_D_SCREENOUTPUT) {
D::printToScreen();
}
if($__mc_D_LOGFILE) {
D::printToFile($__mc_D_LOGFILE,'a');
}
}
?>
\ No newline at end of file
<?
require_once $__PATH_to_mcClasses .'include.php';
require_once $__PATH_to_mcClasses .'config.php';
/**
* dinge die am Ende noch ausgeführt werden sollen
*
* (nur für Dinge die unter mcClasses sind)
*
* @author f@mensch.coop @since 2010-12-17
*/
if($__mc_ERRORHANDLER) {
require_once $__PATH_to_mcClasses.'ReportHandling/fnc_mcErrorHandler.inc.php';
set_error_handler('mcErrorHandler');
}
if($_LOSP_DEV) {
error_reporting(E_ALL);
$var_message = '['.date('d. m. Y G:i').'] DEVMODE: logfile wurde zurvor geloescht';
if($__mc_D_LOGFILE) {
unlink ( $__mc_D_LOGFILE );
mcFile::write($__mc_D_LOGFILE, $var_message, 'w');
}
//mcFile::write('log/tmp.bla', date('d.m.Y G:i:s').': '.$_SERVER['SCRIPT_NAME'].' -- '.$_SERVER['REQUEST_URI'].mcCONST::TAB.($_SERVER['SCRIPT_NAME']==$_SERVER['REQUEST_URI']).mcCONST::LINEBREAK, 'a');
foreach($__mc_Report as $Report) {
foreach($Report as $kindofDistribute => $params) {
if($kindofDistribute == 'toFile') {
if($params['reset']) {
unlink ( $params['file'] );
mcFile::write($params['file'], $var_message, 'w');
}
}
}
}
D::start();
}
?>
\ No newline at end of file
<?
/**
* include the mcClasses libary
*
* @author dev@mensch.coop
* @since 2011-01-07
*/
require_once("basepath.inc.php");
require_once $__PATH_to_mcClasses . 'class_mcMail.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcFile.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcCONST.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcCsv.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcDeprecated.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcReport.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_Error.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_Message.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcEvent.inc.php';
require_once $__PATH_to_mcClasses . 'ReportHandling/class_mcEvent.inc.php';
require_once $__PATH_to_mcClasses . 'D/class_D.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcException.inc.php';
require_once $__PATH_to_mcClasses . 'class_mcPerformance.inc.php';
?>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!