This commit is contained in:
Bob Weinand 2013-11-25 23:45:55 +01:00
parent 4e6a8eeffa
commit 02ae3f8de1
6 changed files with 80 additions and 49 deletions

View file

@ -41,16 +41,38 @@ PHPDBG_SET(prompt) /* {{{ */
return SUCCESS;
} /* }}} */
PHPDBG_SET(break) /* {{{ */
{
switch (param->type) {
case EMPTY_PARAM:
phpdbg_writeln("%s",
PHPDBG_G(flags) & PHPDBG_IS_BP_ENABLED ? "on" : "off");
break;
case STR_PARAM:
if (strncasecmp(param->str, PHPDBG_STRL("on")) == 0) {
PHPDBG_G(flags) |= PHPDBG_IS_BP_ENABLED;
} else if (strncasecmp(param->str, PHPDBG_STRL("off")) == 0) {
PHPDBG_G(flags) ^= PHPDBG_IS_BP_ENABLED;
}
break;
phpdbg_default_switch_case();
}
return SUCCESS;
} /* }}} */
PHPDBG_SET(color) /* {{{ */
{
if ((param->type == STR_PARAM) && (input->argc == 3)) {
const phpdbg_color_t *color = phpdbg_get_color(
input->argv[2]->string, input->argv[2]->length TSRMLS_CC);
int element = PHPDBG_COLOR_INVALID;
if (color) {
if (phpdbg_argv_is(1, "prompt")) {
phpdbg_notice(
if (phpdbg_argv_is(1, "prompt")) {
phpdbg_notice(
"setting prompt color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_PROMPT;
if (PHPDBG_G(prompt)[1]) {
@ -58,16 +80,16 @@ PHPDBG_SET(color) /* {{{ */
PHPDBG_G(prompt)[1]=NULL;
}
} else if (phpdbg_argv_is(1, "error")) {
phpdbg_notice(
phpdbg_notice(
"setting error color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_ERROR;
} else if (phpdbg_argv_is(1, "notice")) {
phpdbg_notice(
phpdbg_notice(
"setting notice color to %s (%s)", color->name, color->code);
element = PHPDBG_COLOR_NOTICE;
} else goto usage;
} else goto usage;
/* set color for element */
phpdbg_set_color(element, color TSRMLS_CC);