Commit 6516bdeb by Frederick d. Maus

D::cf

1 parent 612ea079
......@@ -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
* <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);
D::printCurrentFunction($param_print);
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) {
self::printCurrentFunction($param_print);
......@@ -229,31 +233,35 @@ class D {
* @static
*/
private static function printCurrentFunction($param_print, $param_string='') {
private static function printCurrentFunction($param_print, $param_string='', $param_onlyFunction=false) {
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++;
if($param_onlyFunction) {
self::new_echo(''.$array[$i-1]["line"].':'.$array[$i]["class"].$array[$i]["type"].$array[$i]["function"].'(): '.$param_string);
} 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']);
}
// 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>';
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>';
}
}
}
}
......
......@@ -5,6 +5,40 @@
* SEOLinkCache eingesetzt werden
*/
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) {
$searcharray = $param_Array;
foreach($param_PathAsArray as $key) {
......
......@@ -26,6 +26,7 @@ if(!isset($__mc_D_LOGFILE)) {
* @var string -- file for the D Output
*/
$__mc_D_LOGFILE = $__BASEPATH_EX.'log/mc.'.$string.'.DEV_D.log';
//
}
if(!isset($__mc_D_SCREENOUTPUT)) {
......
......@@ -19,7 +19,7 @@ if($_LOSP_DEV) {
D::printToScreen();
}
if($__mc_D_LOGFILE) {
D::li($__mc_D_LOGFILE);
// D::li($__mc_D_LOGFILE);
D::printToFile($__mc_D_LOGFILE,'a');
}
}
......
......@@ -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');
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');
if(is_array($__mc_Report)) {
foreach($__mc_Report as $Report) {
foreach($Report as $kindofDistribute => $params) {
if($kindofDistribute == 'toFile') {
if(array_key_exists('reset', $params) && $params['reset']) {
unlink ( $params['file'] );
mcFile::write($params['file'], $var_message, 'w');
}
}
}
}
}
}
D::start();
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!