Exemplo n.º 1
0
/**
* Magic Debugfunction
* You can use it 3 ways.
* <code>
* d($config); // Just an variable. Variables name will be unknown in the output
* d('$config'); // Variable as string. This way the variables name can be written as well.
* d('Any Text', $config); // Write the variables name as a string
* </code>
*
*/
function d()
{
    global $debug, $func;
    $arg_vars = func_get_args();
    if (!isset($debug)) {
        $debug = new debug(1);
    }
    if ($arg_vars[1]) {
        $title = $arg_vars[0];
        $val = $arg_vars[1];
    } elseif (is_string($arg_vars[0]) and substr($arg_vars[0], 0, 1) == '$') {
        $title = $arg_vars[0];
        eval('global ' . $arg_vars[0] . '; $val = ' . $arg_vars[0] . ';');
    } else {
        $title = 'Variable';
        $val = $arg_vars[0];
    }
    $func->information($title . ':<br>"' . nl2br(str_replace(' ', '&nbsp;', htmlentities(print_r($val, true)))) . '"', NO_LINK);
    if ($title == 'Variable') {
        if (is_numeric($val)) {
            $title = $val;
        } elseif (is_string($val)) {
            $title = substr($val, 0, 10);
        } else {
            $title = 'No title given';
        }
    }
    $debug->tracker('Debug point: ' . $title);
}
Exemplo n.º 2
0
    $debug = new debug($config['lansuite']['debugmode']);
}
include_once "inc/classes/class_translation.php";
// Load Translationclass. No t()-Function before this point!
$translation = new translation();
include_once 'ext_scripts/smarty/Smarty.class.php';
$smarty = new Smarty();
$smarty->template_dir = '.';
$smarty->compile_dir = './ext_inc/templates_c/';
$smarty->cache_dir = './ext_inc/templates_cache/';
$smarty->caching = false;
$smarty->cache_lifetime = 0;
// sec
#$smarty->compile_check = 0;
if (isset($debug)) {
    $debug->tracker("Include and Init Smarty");
}
include_once "inc/classes/class_display.php";
// Display Functions (to load the lansuite-templates)
$dsp = new display();
include_once "inc/classes/class_db_mysql.php";
// DB Functions (to work with the databse)
$db = new db();
include_once "inc/classes/class_sec.php";
// Security Functions (to lock pages)
$sec = new sec();
if (isset($debug)) {
    $debug->tracker("Include and Init Base Classes");
}
### Initalize Basic Parameters
$language = $translation->get_lang();