*', '>=*', '<*', '<=*' - compare $reqValue * examples: * - show when $_REQUEST['DBG_SCH'] == '1' * DBG::_('DBG_SCH', '1', "fieldsConfig({$idTable})", $fieldsConfig, __CLASS__, __FUNCTION__, __LINE__); * - show when $_REQUEST['DBG_SCH'] > '1' * DBG::_('DBG_SCH', '>1', "fieldsConfig({$idTable})", $fieldsConfig, __CLASS__, __FUNCTION__, __LINE__); * - show when any value: strlen($_REQUEST['DBG_SCH']) > 0 * DBG::_('DBG_SCH', true, "fieldsConfig({$idTable})", $fieldsConfig, __CLASS__, __FUNCTION__, __LINE__); * - always show * DBG::_(true, true, "fieldsConfig({$idTable})", $fieldsConfig, __CLASS__, __FUNCTION__, __LINE__); */ public static function _($reqKey, $reqValueExpr, $label, $variable, $className, $functionName, $lineNumber, $borderColor = 'red') { if (!DBG::isActive()) return; $showDBG = false; $reqValue = (true === $reqKey || !$reqKey)? '' : V::get($reqKey, '', $_GET); if (true === $reqKey) { $showDBG = true; } else if (strlen($reqValue) == 0) { return; } else if ($reqValue == $reqValueExpr) { $showDBG = true; } else if (true === $reqValueExpr) { $showDBG = true; } else { if ('>=' == substr($reqValueExpr, 0, 2)) { if ($reqValue >= substr($reqValueExpr, 2)) { $showDBG = true; } } else if ('>' == substr($reqValueExpr, 0, 1)) { if ($reqValue > substr($reqValueExpr, 1)) { $showDBG = true; } } else if ('<=' == substr($reqValueExpr, 0, 2)) { if ($reqValue <= substr($reqValueExpr, 2)) { $showDBG = true; } } else if ('<' == substr($reqValueExpr, 0, 1)) { if ($reqValue < substr($reqValueExpr, 1)) { $showDBG = true; } } else { if ($reqValue = $reqValueExpr) { $showDBG = true; } } } if ($showDBG) { ?>


'#96c178', 'red'=>'#de6b74', 'blue'=>'#55b5c1', 'bg-dark'=>'#282c34', 'white'=>'#abb2bf', 'orange'=>'#d19a66', 'violet'=>'#c476db']; $cnt = ''; ob_start(); print_r($variable); $cnt = ob_get_contents(); ob_end_clean(); $outLines = array(); $lines = explode("\n", $cnt); foreach ($lines as $line) { if ('(' == trim($line)) continue; if (')' == trim($line)) continue; if ('' == trim($line)) continue; if ('Array' == substr($line, -5) || 'stdClass' == substr($line, -5)) { $line = str_replace('Array', 'Array', $line); $line = str_replace('stdClass', 'stdClass', $line); $line .= ':'; } if (($firstBracket = strpos($line, '[')) > 0) { $line = str_replace("\t", ' ', $line); $splitPos = ($firstBracket > 4)? ($firstBracket - 4) / 2 + 4 : 4; $line = substr($line, $firstBracket - $splitPos); $line = preg_replace('/\[(\w+)\]/', '[\1]', $line); $line = preg_replace('/\] \=\> (.+)$/', '] => \1', $line); } $outLines[] = $line; } if ($varName) $outLines[0] = '' . $varName . " => {$outLines[0]}"; $outLines = implode("\n", $outLines); echo '
' . $outLines . '
' . "\n"; } }