summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2004-05-17 20:09:37 +0000
committerAndrei Zmievski <andrei@php.net>2004-05-17 20:09:37 +0000
commit427561446fe3b43619d53590da27f9ca9e8d0830 (patch)
tree8de5cc52ab1a022db8fa3aad6e4651ec026a11f5 /Zend
parentcf4127b6b9134afb417e83779955ffe5b7c9ff2a (diff)
downloadphp-git-427561446fe3b43619d53590da27f9ca9e8d0830.tar.gz
Revert the .ini vars patch. Will have to try again next Christmas
apparently.
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend_ini_parser.y53
-rw-r--r--Zend/zend_ini_scanner.l14
2 files changed, 7 insertions, 60 deletions
diff --git a/Zend/zend_ini_parser.y b/Zend/zend_ini_parser.y
index abb1949f1c..1d90e34f5f 100644
--- a/Zend/zend_ini_parser.y
+++ b/Zend/zend_ini_parser.y
@@ -92,24 +92,6 @@ void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
result->type = IS_STRING;
}
-void zend_ini_init_string(zval *result)
-{
- result->value.str.val = malloc(1);
- result->value.str.val[0] = 0;
- result->value.str.len = 0;
- result->type = IS_STRING;
-}
-
-void zend_ini_add_string(zval *result, zval *op1, zval *op2)
-{
- int length = op1->value.str.len + op2->value.str.len;
-
- result->value.str.val = (char *) realloc(op1->value.str.val, length+1);
- memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len);
- result->value.str.val[length] = 0;
- result->value.str.len = length;
- result->type = IS_STRING;
-}
void zend_ini_get_constant(zval *result, zval *name)
{
@@ -130,20 +112,6 @@ void zend_ini_get_constant(zval *result, zval *name)
}
}
-void zend_ini_get_var(zval *result, zval *name)
-{
- zval curval;
- char *envvar;
- TSRMLS_FETCH();
-
- if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) {
- result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len);
- result->value.str.len = curval.value.str.len;
- } else {
- zend_ini_init_string(result);
- }
-}
-
static void ini_error(char *str)
{
@@ -207,7 +175,6 @@ int zend_parse_ini_file(zend_file_handle *fh, zend_bool unbuffered_errors, zend_
%token SECTION
%token CFG_TRUE
%token CFG_FALSE
-%token TC_DOLLAR_CURLY
%left '|' '&'
%right '~' '!'
@@ -243,27 +210,13 @@ statement:
string_or_value:
expr { $$ = $1; }
+ | TC_ENCAPSULATED_STRING { $$ = $1; }
| CFG_TRUE { $$ = $1; }
| CFG_FALSE { $$ = $1; }
- | var_string_list { $$ = $1; }
- | '\n' { zend_ini_init_string(&$$); }
- | /* empty */ { zend_ini_init_string(&$$); }
-;
-
-
-var_string_list:
- var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); }
- | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); }
- | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); }
- | /* empty */ { zend_ini_init_string(&$$); }
+ | '\n' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
+ | /* empty */ { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
;
-
-cfg_var_ref:
- TC_DOLLAR_CURLY TC_STRING '}' { zend_ini_get_var(&$$, &$2); }
-;
-
-
expr:
constant_string { $$ = $1; }
| expr '|' expr { zend_ini_do_op('|', &$$, &$1, &$3); }
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 3217e08f56..f2da5998e3 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -153,20 +153,12 @@ NEWLINE ("\r"|"\n"|"\r\n")
return TC_ENCAPSULATED_STRING;
}
-<INITIAL>[&|~$(){}!] {
+<INITIAL>[&|~()!] {
return yytext[0];
}
-<INITIAL>"${" {
- return TC_DOLLAR_CURLY;
-}
-
-<INITIAL>"}" {
- ini_lval->value.lval = (long) yytext[0];
- return yytext[0];
-}
-<INITIAL>[^=\n\r\t;|&$~(){}!"\[]+ {
+<INITIAL>[^=\n\r\t;|&~()!"\[]+ {
/* STRING */
register int i;
@@ -198,6 +190,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
}
+
+
<INITIAL>[=\n] {
if (yytext[0] == '\n') {
SCNG(lineno)++;