Blame view

class_D.inc.php 20.5 KB
Frederick committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<?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);
36 37 38 39
		
		
		$textstring = strip_tags($textstring);
		
Frederick committed
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
		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);
		}
Frederick d. Maus committed
77 78
//		D::li(highlight_string($param_query, true));
		D::li($param_query, $param_print, $param_force);
Frederick committed
79 80 81 82 83 84 85
		D::show($param_bindValueArray, $param_query);
	}

	private static function new_echo($param_string, $param_print=true, $param_force=false) {


		if(trim($param_string)) {
86 87
			if($param_htmlentities)
				$param_string=htmlentities($param_string);
Frederick committed
88 89 90 91 92 93 94 95 96 97 98 99
			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++;
		}
	}

100 101 102 103 104 105 106 107 108 109 110 111 112 113
	/**
	 * function htmlencode a string or array values () 
	 * 
	 * @param array/string $param_val
	 */
	public static function htmlencode_arrayvalues($param_val){
		if(is_array($param_val)){
			foreach($param_val as $key => $value){
				$param_val[$key]=self::htmlencode_arrayvalues($value);
			};
			return $param_val;
		}
		return htmlentities($param_val);
	}
Frederick committed
114 115 116 117
	/**
	 * Funktion zeigt ein Objekt/Array html strukturiert an
	 *	anstelle von var_dump
	 */
118
	public static function show($param_val, $param_string="", $param_print=true, $param_force=false, $param_htmlentities=false) {
Frederick committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135

//		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>";
136 137 138
			if($param_htmlentities){
				$param_val=self::htmlencode_arrayvalues($param_val);
			}
Frederick committed
139
			self::new_echo($string_show.print_r($param_val, true).'"</pre>"', $param_print, $param_force);
140 141
			
			
Frederick committed
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
//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);
		}


	}

161
	public static function cf($param_string='', $param_print=true, $param_force=false) {
Frederick d. Maus committed
162 163 164
		D::printCurrentFunction($param_print, $param_string, true);
	}
	
Frederick committed
165 166 167 168 169
	/**
	 * Funktion zeigt html liste
	 * <li>$param_string</li>
	 */
	public static function li($param_string, $param_print=true, $param_force=false) {
Frederick d. Maus committed
170 171
		D::printCurrentFunction($param_print);
		D::new_echo("<li>".$param_string."</li>", $param_print, $param_force);
Frederick committed
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
	}
	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) {
207
		self::printCurrentFunction($param_print);
Frederick committed
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
		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
	 */

Frederick d. Maus committed
256
	private static function printCurrentFunction($param_print, $param_string='', $param_onlyFunction=false) {
Frederick committed
257 258 259 260
		if($param_print) {
			$array = debug_backtrace();
			$i=2;

Frederick d. Maus committed
261
			if($param_onlyFunction) {
Frederick d. Maus committed
262
				self::new_echo(''.$array[$i]["class"].$array[$i]["type"].$array[$i]["function"].'(Z'.$array[$i-1]["line"].'): '.$param_string);
Frederick d. Maus committed
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
			} else {
				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']);
Frederick committed
278 279
					}

Frederick d. Maus committed
280 281 282 283 284
					self::new_echo($param_string."    <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> call in row ".$array[$i]["line"]." in <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']."() call in ".basename($array[$i-1]["file"])." Zeile: ".$array[$i-1]["line"]." </i>]");
					//echo '___________<pre>';
					//echo	print_r($array[$i], true);
					//echo '</pre>';
				}				
Frederick committed
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
			}
		}
	}

	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);
	}


}

?>