Beispiel #1
0
 public function status()
 {
     $status = array();
     foreach ($this->store as $k => $v) {
         $status[$k] = var_info($v);
     }
     ksort($status);
     return $status;
 }
function smarty_function_debug_dump($params, &$smarty)
{
    $content = '<pre style="width:600px; max-width: 600px; height:300px; max-height:300px; overflow: auto;">';
    if ($params['var']) {
        if ($params['var'] == '__keys__') {
            $content .= 'tpl_vars=' . var_info(array_keys($smarty->_tpl_vars));
        } else {
            if (isset($smarty->_tpl_vars[$params['var']])) {
                $content .= "{$params['var']}=" . var_info($smarty->_tpl_vars[$params['var']]);
            } else {
                $content .= "No such variable: {$params['var']}";
            }
        }
    } else {
        $content .= "tpl_vars=" . var_info($smarty->_tpl_vars);
    }
    $content .= '</pre>';
    if (!empty($params['assign'])) {
        $smarty->assign($params['assign'], $content);
        return;
    }
    return $content;
}
Beispiel #3
0
require_once dirname(__FILE__) . '/includes/libs/tnt/tnt.inc';
/*
 * Globals
 */
/*
 * Defines
 */
define('__SITE__', 'tnt');
/* Report all errors and warnings */
error_reporting(E_ALL);
/*
 * Disable session.use_trans_sid to mitigate performance-penalty
 * (do it before any output is started)
 */
if (!defined('SID')) {
    @ini_set('session.use_trans_sid', 0);
}
TNT::Initialise(__SITE__, 1);
TNTLoader::RequireClass('TNTCtrlHttpFront');
$front =& TNTCtrlHttpFront::Singleton();
if (!$front->Main()) {
    echo '<pre>Error: ' . htmlentities($front->Error()) . '</pre>';
}
$ini =& TNT::Registry();
echo '<hr />';
tnt_dump('TNT_ROOT_DIR: ', TNT_ROOT_DIR);
tnt_dump('TNT_ROOT_URI: ', TNT_ROOT_URI);
tnt_dump('Config: ', var_info($ini->Items()));
echo '<hr />';
TNT::Shutdown();
/* vim: set expandtab tabstop=4 shiftwidth=4: */
Beispiel #4
0
 /**
  * Get human-readable info about the type of the value.
  *
  * @param  mixed $value The value to get the info for.
  *
  * @return string The info about the value as string.
  */
 protected function var_info($value)
 {
     if (defined('STRICT_TYPES') && CAMEL_CASE == '1') {
         return (string) self::parameters(['value' => DT::ANY])->call(__FUNCTION__)->with($value)->returning(DT::STRING);
     } else {
         return (string) var_info($value);
     }
 }
Beispiel #5
0
function assert_interface($var, $interface)
{
    if (!is_object($var) || !$var instanceof $interface) {
        throw new \InvalidArgumentException(var_info($var) . " does not implement {$interface}");
    }
}