";
if(!extension_loaded('bbcode')) {
dl('bbcode.' . PHP_SHLIB_SUFFIX);
}
$module = 'bbcode';
$functions = get_extension_funcs($module);
/*echo "Functions available in the test extension:$br\n";
foreach($functions as $func) {
echo $func."$br\n";
}*/
echo "$br\n";
$function = 'confirm_' . $module . '_compiled';
if (extension_loaded($module)) {
$obj = new $module(
[
'' => [
'type' => BBCODE::TYPE_ROOT,
'childs' => ['ul','url','img','b','i']
],
'i' => [
'type' => BBCODE::TYPE_NOARG
//TODO: by default open tag = and close tag =
],
'b' => [
'type' => BBCODE::TYPE_NOARG
],
'ul' => [
'type' => BBCODE::TYPE_NOARG,
'childs' => [ 'li' ]
],
'li' => [
'type' => BBCODE::TYPE_NOARG,
'parent' => 'ul',
'childs' => ['url','img','b','i']
],
'url' => [
'type' => BBCODE::TYPE_OPTARG,
'open_tag' => '',
'close_tag' => '',
'default_arg' => '{CONTENT}',
'parent' => [ '', 'li', 'b', 'i' ]
]
],
[
':)' => '',
':(' => '',
':D' => '',
':p' => '',
':|' => '',
':6:' => ''
],
BBCode::REMOVE_EMPTY
);
$obj2 = new $module(
[
'' => [
'type' => BBCODE::TYPE_ROOT,
'childs' => ['ul','url','img','b','i']
],
'i' => [
'type' => BBCODE::TYPE_NOARG
//TODO: by default open tag = and close tag =
],
'b' => [
'type' => BBCODE::TYPE_NOARG
],
'ul' => [
'type' => BBCODE::TYPE_NOARG,
'childs' => [ 'li' ]
],
'li' => [
'type' => BBCODE::TYPE_NOARG,
'parent' => 'ul',
'childs' => ['url','img','b','i']
],
'url' => [
'type' => BBCODE::TYPE_OPTARG,
'open_tag' => '',
'close_tag' => '',
'default_arg' => '{CONTENT}',
'parent' => [ '', 'li', 'b', 'i' ]
]
],
[
':)' => '',
':(' => '',
':D' => '',
':p' => '',
':|' => '',
':6:' => ''
],
BBCode::REMOVE_EMPTY
);
$obj3 = new $module(
[
'' => [
'type' => BBCODE::TYPE_ROOT,
'childs' => ['ul','url','img','b','i']
],
'i' => [
'type' => BBCODE::TYPE_NOARG
//TODO: by default open tag = and close tag =
],
'b' => [
'type' => BBCODE::TYPE_NOARG
],
'ul' => [
'type' => BBCODE::TYPE_NOARG,
'childs' => [ 'li' ]
],
'li' => [
'type' => BBCODE::TYPE_NOARG,
'parent' => 'ul',
'childs' => ['url','img','b','i']
],
'url' => [
'type' => BBCODE::TYPE_OPTARG,
'open_tag' => '',
'close_tag' => '',
'default_arg' => '{CONTENT}',
'parent' => [ '', 'li', 'b', 'i' ]
]
],
[
':)' => '',
':(' => '',
':D' => '',
':p' => '',
':|' => '',
':6:' => ''
],
BBCode::REMOVE_EMPTY
);
$obj3 = null;
unset($obj2);
var_dump($obj2 = clone $obj);
var_dump($obj3 = clone $obj);
var_dump($obj4 = clone $obj);
var_dump($obj5 = clone $obj);
var_dump($obj6 = clone $obj);
var_dump($obj2 = clone $obj);
//var_dump(new $module(BBCode::TYPE_ARG, 'tutu'));
exit;
//$str = $function($module);
} else {
$str = "Module $module is not compiled into PHP";
}
echo "$str\n";
/*
array(
'b' => array(
'type'=>BBCODE_TYPE_NOARG,
'open_tag'=>'',
'close_tag'=>'',
'flags'=>BBCODE_FLAGS_REMOVE_IF_EMPTY
),
'u' => array(
'type'=>BBCODE_TYPE_NOARG,
'open_tag'=>'',
'close_tag'=>'',
'flags'=>BBCODE_FLAGS_SMILEYS_OFF | BBCODE_FLAGS_REMOVE_IF_EMPTY | BBCODE_FLAGS_SMILEYS_OFF
),
'i' => array(
'type'=>BBCODE_TYPE_NOARG,
'open_tag'=>'',
'close_tag'=>'',
'flags'=>BBCODE_FLAGS_REMOVE_IF_EMPTY
)
),
*/