Commit 6516bdeb by Frederick d. Maus

D::cf

1 parent 612ea079
...@@ -138,13 +138,17 @@ class D { ...@@ -138,13 +138,17 @@ class D {
} }
public static function cf($param_string, $param_print=true, $param_force=false) {
D::printCurrentFunction($param_print, $param_string, true);
}
/** /**
* Funktion zeigt html liste * Funktion zeigt html liste
* <li>$param_string</li> * <li>$param_string</li>
*/ */
public static function li($param_string, $param_print=true, $param_force=false) { public static function li($param_string, $param_print=true, $param_force=false) {
self::printCurrentFunction($param_print); D::printCurrentFunction($param_print);
self::new_echo("<li>".$param_string."</li>", $param_print, $param_force); D::new_echo("<li>".$param_string."</li>", $param_print, $param_force);
} }
public static function kindof($param_kindof, $param_string="", $param_print=true, $param_force=false) { public static function kindof($param_kindof, $param_string="", $param_print=true, $param_force=false) {
self::printCurrentFunction($param_print); self::printCurrentFunction($param_print);
...@@ -229,31 +233,35 @@ class D { ...@@ -229,31 +233,35 @@ class D {
* @static * @static
*/ */
private static function printCurrentFunction($param_print, $param_string='') { private static function printCurrentFunction($param_print, $param_string='', $param_onlyFunction=false) {
if($param_print) { if($param_print) {
$array = debug_backtrace(); $array = debug_backtrace();
$i=2; $i=2;
if(is_array($array) && array_key_exists($i,$array)){ if($param_onlyFunction) {
self::new_echo(''.$array[$i-1]["line"].':'.$array[$i]["class"].$array[$i]["type"].$array[$i]["function"].'(): '.$param_string);
// echo 'hello<br><pre>'; } else {
// print_r($array[1]); if(is_array($array) && array_key_exists($i,$array)){
// echo '</pre>';
$var_depth = 0; // echo 'hello<br><pre>';
for($v=0; $v<count($array);$v++){ // print_r($array[1]);
if( array_key_exists('class', $array[$v]) && array_key_exists('class', $array[$i]) // echo '</pre>';
&& $var_depth = 0;
$array[$v]['class'].$array[$v]['type'].$array[$v]['function']==$array[$i]['class'].$array[$i]['type'].$array[$i]['function'] for($v=0; $v<count($array);$v++){
){ if( array_key_exists('class', $array[$v]) && array_key_exists('class', $array[$i])
$var_depth++; &&
$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']);
} }
// 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>"); 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 '___________<pre>';
//echo print_r($array[$i], true); //echo print_r($array[$i], true);
//echo '</pre>'; //echo '</pre>';
}
} }
} }
} }
......
...@@ -5,6 +5,40 @@ ...@@ -5,6 +5,40 @@
* SEOLinkCache eingesetzt werden * SEOLinkCache eingesetzt werden
*/ */
class mcArray { class mcArray {
/**
* check if key path is in array and value is not emtpy array
*
* @param array $param_Array
* @param string $param_key -- $param_Array[$param_key]
* @param string $param_key2 -- $param_Array[$param_key][$param_key2]
* @param string $param_key3 -- $param_Array[$param_key][$param_key2][$param_key3]
* @param string $param_key4 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4]
* @param string $param_key5 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4][$param_key5]
* @param string $param_key6 -- $param_Array[$param_key][$param_key2][$param_key3][$param_key4][$param_key5][$param_key6]
* @return bool
*/
public static function checkKeyHasFullArray($param_Array, $param_key, $param_key2=null, $param_key3=null, $param_key4=null, $param_key5=null, $param_key6=null) {
if(is_array($param_Array)) {
if(array_key_exists($param_key, $param_Array)
&& is_array($param_Array[$param_key])
&& !empty($param_Array[$param_key])
) {
if(is_null($param_key2)) {
return true;
} else {
return mcArray::checkKeyHasFullArray($param_Array[$param_key], $param_key2, $param_key3, $param_key4, $param_key5);
}
} else {
return false;
}
} else {
return false;
}
}
public static function returnValueFromKeyPath(array $param_PathAsArray, array $param_Array) { public static function returnValueFromKeyPath(array $param_PathAsArray, array $param_Array) {
$searcharray = $param_Array; $searcharray = $param_Array;
foreach($param_PathAsArray as $key) { foreach($param_PathAsArray as $key) {
......
...@@ -26,6 +26,7 @@ if(!isset($__mc_D_LOGFILE)) { ...@@ -26,6 +26,7 @@ if(!isset($__mc_D_LOGFILE)) {
* @var string -- file for the D Output * @var string -- file for the D Output
*/ */
$__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_D.log'; $__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_D.log';
//
} }
if(!isset($__mc_D_SCREENOUTPUT)) { if(!isset($__mc_D_SCREENOUTPUT)) {
......
...@@ -19,7 +19,7 @@ if($_LOSP_DEV) { ...@@ -19,7 +19,7 @@ if($_LOSP_DEV) {
D::printToScreen(); D::printToScreen();
} }
if($__mc_D_LOGFILE) { if($__mc_D_LOGFILE) {
D::li($__mc_D_LOGFILE); // D::li($__mc_D_LOGFILE);
D::printToFile($__mc_D_LOGFILE,'a'); D::printToFile($__mc_D_LOGFILE,'a');
} }
} }
......
...@@ -36,17 +36,20 @@ if($_LOSP_DEV) { ...@@ -36,17 +36,20 @@ if($_LOSP_DEV) {
} }
} }
//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'); //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) { if(is_array($__mc_Report)) {
foreach($Report as $kindofDistribute => $params) { foreach($__mc_Report as $Report) {
if($kindofDistribute == 'toFile') { foreach($Report as $kindofDistribute => $params) {
if($params['reset']) { if($kindofDistribute == 'toFile') {
unlink ( $params['file'] ); if(array_key_exists('reset', $params) && $params['reset']) {
mcFile::write($params['file'], $var_message, 'w'); unlink ( $params['file'] );
mcFile::write($params['file'], $var_message, 'w');
}
} }
} }
} }
} }
D::start(); D::start();
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!