本文整理汇总了PHP中debug::active方法的典型用法代码示例。如果您正苦于以下问题:PHP debug::active方法的具体用法?PHP debug::active怎么用?PHP debug::active使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类debug
的用法示例。
在下文中一共展示了debug::active方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replace
public static function replace($pattern, $replace, $string)
{
$error = '';
$str = @preg_replace($pattern, $replace, $string) | $error;
echo $error;
if (debug::active()) {
$error = error_get_last();
if (strstr($error['message'], 'preg_replace')) {
$msg = str_replace('preg_replace() [<a href=\'function.preg-replace\'>function.preg-replace</a>]:', '', $error['message']);
debug::add($msg . ' in ' . $pattern, 'ERROR');
}
}
return $str;
}
示例2: get_request
function get_request($arg)
{
if (debug::active()) {
debug::add($arg);
}
$Req = '$_REQUEST' . $this->string_to_index($arg);
if (eval("return isset({$Req});") && eval("return {$Req};") != '') {
if (is_array(eval("return {$Req};"))) {
return $this->get_request_array(eval("return {$Req};"));
} else {
return $this->filter_request(eval("return {$Req};"));
}
} else {
return '';
}
}
示例3: init
/**
* init attribs
*
* @acess protected
*/
function init()
{
parent::init();
if ($this->disabled === true) {
$this->_init .= ' disabled="disabled"';
}
if ($this->name != '') {
$this->_init .= ' name="' . $this->name . '"';
}
if ($this->tabindex != '') {
$this->_init .= ' tabindex="' . $this->tabindex . '"';
}
if ($this->value != '') {
$this->_init .= ' value="' . $this->value . '"';
}
$this->type = strtolower($this->type);
switch ($this->type) {
case 'submit':
case 'reset':
case 'button':
$this->_init .= ' type="' . $this->type . '"';
break;
default:
$this->_init .= ' type="button"';
if (debug::active()) {
debug::add('type ' . $this->type . ' not supported - type set to button', 'ERROR');
}
break;
}
}
示例4: get_htmlobject_object
function get_htmlobject_object($data)
{
if (isset($data['object']) && isset($data['object']['type']) && isset($data['object']['attrib']) && isset($data['object']['attrib']['name'])) {
// set vars
$object = strtolower($data['object']['type']);
$attribs = $data['object']['attrib'];
$name = $data['object']['attrib']['name'];
// build object
switch ($object) {
case 'htmlobject_input':
case 'htmlobject_select':
case 'htmlobject_textarea':
case 'htmlobject_button':
$html = $this->make_htmlobject($object, $attribs);
break;
default:
if (debug::active()) {
debug::add($object . ' is not supported', 'ERROR');
}
break;
}
// set request
if (isset($this->request) && count($this->request) > 0) {
$request = '$this->request' . $this->string_to_index($name);
}
// build return
if (isset($request) && $request != '' && isset($html)) {
// add request to object
switch ($object) {
case 'htmlobject_input':
$html = $this->handle_htmlobject_input($html, $request);
break;
case 'htmlobject_select':
$html = $this->handle_htmlobject_select($html, $request);
break;
case 'htmlobject_textarea':
$html = $this->handle_htmlobject_textarea($html, $request);
break;
}
return $html;
} elseif (isset($html)) {
return $html;
} else {
return '';
}
}
}