Browse Source

Support boolean NOT in the php.ini processor

PHP-4.0.5
Zeev Suraski 26 years ago
parent
commit
cacbf1ea28
  1. 6
      main/configuration-parser.y
  2. 4
      main/configuration-scanner.l

6
main/configuration-parser.y

@ -384,6 +384,9 @@ void do_cfg_op(char type, zval *result, zval *op1, zval *op2)
case '~':
i_result = ~i_op1;
break;
case '!':
i_result = !i_op1;
break;
default:
i_result = 0;
break;
@ -429,7 +432,7 @@ void do_cfg_get_constant(zval *result, zval *name)
%token T_ZEND_EXTENSION_DEBUG
%token T_ZEND_EXTENSION_DEBUG_TS
%left '|' '&'
%right '~'
%right '~' '!'
%%
@ -568,6 +571,7 @@ expr:
| expr '|' expr { do_cfg_op('|', &$$, &$1, &$3); }
| expr '&' expr { do_cfg_op('&', &$$, &$1, &$3); }
| '~' expr { do_cfg_op('~', &$$, &$2, NULL); }
| '!' expr { do_cfg_op('!', &$$, &$2, NULL); }
| '(' expr ')' { $$ = $2; }
;

4
main/configuration-scanner.l

@ -119,12 +119,12 @@ void init_cfg_scanner()
return TC_ENCAPSULATED_STRING;
}
<INITIAL>[&|~()] {
<INITIAL>[&|~()!] {
return yytext[0];
}
<INITIAL>[^=\n\r\t;|&~()"]+ {
<INITIAL>[^=\n\r\t;|&~()!"]+ {
/* STRING */
register int i;

Loading…
Cancel
Save