summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/basic_functions.c5
-rw-r--r--ext/standard/browscap.c5
-rw-r--r--main/Makefile.in6
-rw-r--r--main/configuration-parser.y432
-rw-r--r--main/configuration-scanner.l182
-rw-r--r--main/php_ini.c218
-rw-r--r--main/php_ini.h3
-rw-r--r--main/php_main.h5
-rw-r--r--win32/php4.dsp6
-rw-r--r--win32/php4.dsw15
-rw-r--r--win32/php4dll.dsp251
-rw-r--r--win32/php4dllts.dsp121
12 files changed, 376 insertions, 873 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 1477cbbc20..a952c8576a 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -2402,14 +2402,15 @@ PHP_FUNCTION(parse_ini_file)
}
convert_to_string_ex(filename);
- fh.handle.fp = V_FOPEN((*filename)->value.str.val, "r");
+ fh.handle.fp = V_FOPEN(Z_STRVAL_PP(filename), "r");
if (!fh.handle.fp) {
php_error(E_WARNING,"Cannot open '%s' for reading", (*filename)->value.str.val);
return;
}
fh.type = ZEND_HANDLE_FP;
+ fh.filename = Z_STRVAL_PP(filename);
array_init(return_value);
- zend_parse_ini_file(&fh, ini_parser_cb, return_value);
+ zend_parse_ini_file(&fh, 0, ini_parser_cb, return_value);
}
/* }}} */
diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c
index 6ca27c6c11..fcbe8e5116 100644
--- a/ext/standard/browscap.c
+++ b/ext/standard/browscap.c
@@ -33,7 +33,7 @@ static zval *current_section;
static void browscap_entry_dtor(zval *pvalue)
{
- if (pvalue->type == IS_OBJECT || pvalue->type == IS_ARRAY) {
+ if (pvalue->type == IS_OBJECT) {
zend_hash_destroy(pvalue->value.obj.properties);
free(pvalue->value.obj.properties);
}
@@ -144,7 +144,8 @@ PHP_MINIT_FUNCTION(browscap)
php_error(E_WARNING,"Cannot open '%s' for reading", browscap);
return FAILURE;
}
- zend_parse_ini_file(&fh, (zend_ini_parser_cb_t) php_browscap_parser_cb, &browser_hash);
+ fh.filename = browscap;
+ zend_parse_ini_file(&fh, 1, (zend_ini_parser_cb_t) php_browscap_parser_cb, &browser_hash);
}
return SUCCESS;
diff --git a/main/Makefile.in b/main/Makefile.in
index 89bf0c41d0..0c83137408 100644
--- a/main/Makefile.in
+++ b/main/Makefile.in
@@ -2,7 +2,6 @@ LTLIBRARY_NAME = libmain.la
LTLIBRARY_SOURCES = \
main.c internal_functions.c snprintf.c php_sprintf.c \
- configuration-parser.c configuration-scanner.c \
safe_mode.c fopen-wrappers.c alloca.c \
php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.c \
strlcat.c mergesort.c reentrancy.c php_variables.c php_ticks.c \
@@ -10,11 +9,6 @@ LTLIBRARY_SOURCES = \
include $(top_srcdir)/build/ltlib.mk
-configuration-parser.h configuration-parser.c: $(srcdir)/configuration-parser.y
- $(YACC) -p cfg -v -d $< -o configuration-parser.c
-
-configuration-scanner.c: $(srcdir)/configuration-scanner.l
- $(LEX) -Pcfg -o$@ -i $<
internal_functions.c: $(srcdir)/internal_functions.c.in $(top_builddir)/config.status
cd $(top_builddir) && \
diff --git a/main/configuration-parser.y b/main/configuration-parser.y
deleted file mode 100644
index b9b281a7aa..0000000000
--- a/main/configuration-parser.y
+++ /dev/null
@@ -1,432 +0,0 @@
-%{
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Zeev Suraski <zeev@zend.com> |
- +----------------------------------------------------------------------+
- */
-
-
-
-/* $Id$ */
-
-#define DEBUG_CFG_PARSER 0
-#include "php.h"
-#include "php_globals.h"
-#include "php_ini.h"
-#include "ext/standard/dl.h"
-#include "ext/standard/file.h"
-#include "zend_extensions.h"
-
-
-#if WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winbase.h>
-#include "win32/wfile.h"
-#endif
-
-#define YYSTYPE zval
-
-#define PARSING_MODE_CFG 0
-#define PARSING_MODE_STANDALONE 2
-
-static HashTable configuration_hash;
-PHPAPI extern char *php_ini_path;
-static HashTable *active_hash_table;
-static char *currently_parsed_filename;
-
-static int parsing_mode;
-
-zval yylval;
-
-extern int cfglex(zval *cfglval);
-extern FILE *cfgin;
-extern int cfglineno;
-extern void init_cfg_scanner(void);
-
-zval *cfg_get_entry(char *name, uint name_length)
-{
- zval *tmp;
-
- if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp)==SUCCESS) {
- return tmp;
- } else {
- return NULL;
- }
-}
-
-
-PHPAPI int cfg_get_long(char *varname,long *result)
-{
- zval *tmp,var;
-
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
- *result=(long)NULL;
- return FAILURE;
- }
- var = *tmp;
- zval_copy_ctor(&var);
- convert_to_long(&var);
- *result = var.value.lval;
- return SUCCESS;
-}
-
-
-PHPAPI int cfg_get_double(char *varname,double *result)
-{
- zval *tmp,var;
-
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
- *result=(double)0;
- return FAILURE;
- }
- var = *tmp;
- zval_copy_ctor(&var);
- convert_to_double(&var);
- *result = var.value.dval;
- return SUCCESS;
-}
-
-
-PHPAPI int cfg_get_string(char *varname, char **result)
-{
- zval *tmp;
-
- if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
- *result=NULL;
- return FAILURE;
- }
- *result = tmp->value.str.val;
- return SUCCESS;
-}
-
-
-static void yyerror(char *str)
-{
- char *error_buf;
- int error_buf_len;
-
- error_buf_len = 128+strlen(currently_parsed_filename); /* should be more than enough */
- error_buf = (char *) emalloc(error_buf_len);
-
- sprintf(error_buf, "Error parsing %s on line %d\n", currently_parsed_filename, cfglineno);
-#ifdef PHP_WIN32
- MessageBox(NULL, error_buf, "PHP Error", MB_OK|MB_TOPMOST|0x00200000L);
-#else
- fprintf(stderr, "PHP: %s", error_buf);
-#endif
- efree(error_buf);
-}
-
-
-static void pvalue_config_destructor(zval *pvalue)
-{
- if (pvalue->type == IS_STRING && pvalue->value.str.val != empty_string) {
- free(pvalue->value.str.val);
- }
-}
-
-
-int php_init_config(void)
-{
- PLS_FETCH();
-
- if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1)==FAILURE) {
- return FAILURE;
- }
-
-#if USE_CONFIG_FILE
- {
- char *env_location,*default_location,*php_ini_search_path;
- int safe_mode_state = PG(safe_mode);
- char *open_basedir = PG(open_basedir);
- char *opened_path;
- int free_default_location=0;
-
- env_location = getenv("PHPRC");
- if (!env_location) {
- env_location="";
- }
-#ifdef PHP_WIN32
- {
- if (php_ini_path) {
- default_location = php_ini_path;
- } else {
- default_location = (char *) malloc(512);
-
- if (!GetWindowsDirectory(default_location,255)) {
- default_location[0]=0;
- }
- free_default_location=1;
- }
- }
-#else
- if (!php_ini_path) {
- default_location = CONFIGURATION_FILE_PATH;
- } else {
- default_location = php_ini_path;
- }
-#endif
-
-/* build a path */
- php_ini_search_path = (char *) malloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
-
- if (!php_ini_path) {
-#ifdef PHP_WIN32
- sprintf(php_ini_search_path,".;%s;%s",env_location,default_location);
-#else
- sprintf(php_ini_search_path,".:%s:%s",env_location,default_location);
-#endif
- } else {
- /* if path was set via -c flag, only look there */
- strcpy(php_ini_search_path,default_location);
- }
- PG(safe_mode) = 0;
- PG(open_basedir) = NULL;
- cfgin = php_fopen_with_path("php.ini","r",php_ini_search_path,&opened_path);
- free(php_ini_search_path);
- if (free_default_location) {
- free(default_location);
- }
- PG(safe_mode) = safe_mode_state;
- PG(open_basedir) = open_basedir;
-
- if (!cfgin) {
- return SUCCESS; /* having no configuration file is ok */
- }
-
- if (opened_path) {
- zval tmp;
-
- tmp.value.str.val = strdup(opened_path);
- tmp.value.str.len = strlen(opened_path);
- tmp.type = IS_STRING;
- zend_hash_update(&configuration_hash,"cfg_file_path",sizeof("cfg_file_path"),(void *) &tmp,sizeof(zval),NULL);
-#if DEBUG_CFG_PARSER
- php_printf("INI file opened at '%s'\n",opened_path);
-#endif
- efree(opened_path);
- }
-
- init_cfg_scanner();
- active_hash_table = &configuration_hash;
- parsing_mode = PARSING_MODE_CFG;
- currently_parsed_filename = "php.ini";
- yyparse();
- fclose(cfgin);
- }
-
-#endif
-
- return SUCCESS;
-}
-
-
-int php_shutdown_config(void)
-{
- zend_hash_destroy(&configuration_hash);
- return SUCCESS;
-}
-
-
-void do_cfg_op(char type, zval *result, zval *op1, zval *op2)
-{
- int i_result;
- int i_op1, i_op2;
- char str_result[MAX_LENGTH_OF_LONG];
-
- i_op1 = atoi(op1->value.str.val);
- free(op1->value.str.val);
- if (op2) {
- i_op2 = atoi(op2->value.str.val);
- free(op2->value.str.val);
- } else {
- i_op2 = 0;
- }
-
- switch (type) {
- case '|':
- i_result = i_op1 | i_op2;
- break;
- case '&':
- i_result = i_op1 & i_op2;
- break;
- case '~':
- i_result = ~i_op1;
- break;
- case '!':
- i_result = !i_op1;
- break;
- default:
- i_result = 0;
- break;
- }
-
- result->value.str.len = zend_sprintf(str_result, "%d", i_result);
- result->value.str.val = (char *) malloc(result->value.str.len+1);
- memcpy(result->value.str.val, str_result, result->value.str.len);
- result->value.str.val[result->value.str.len] = 0;
- result->type = IS_STRING;
-}
-
-
-void do_cfg_get_constant(zval *result, zval *name)
-{
- zval z_constant;
-
- if (zend_get_constant(name->value.str.val, name->value.str.len, &z_constant)) {
- /* z_constant is emalloc()'d */
- convert_to_string(&z_constant);
- result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len);
- result->value.str.len = z_constant.value.str.len;
- result->type = z_constant.type;
- zval_dtor(&z_constant);
- free(name->value.str.val);
- } else {
- *result = *name;
- }
-}
-
-
-%}
-
-%pure_parser
-%token TC_STRING
-%token TC_ENCAPSULATED_STRING
-%token SECTION
-%token CFG_TRUE
-%token CFG_FALSE
-%token EXTENSION
-%token T_ZEND_EXTENSION
-%token T_ZEND_EXTENSION_TS
-%token T_ZEND_EXTENSION_DEBUG
-%token T_ZEND_EXTENSION_DEBUG_TS
-%left '|' '&'
-%right '~' '!'
-
-%%
-
-statement_list:
- statement_list statement
- | /* empty */
-;
-
-statement:
- TC_STRING '=' string_or_value {
-#if DEBUG_CFG_PARSER
- printf("'%s' = '%s'\n",$1.value.str.val,$3.value.str.val);
-#endif
- $3.type = IS_STRING;
- switch (parsing_mode) {
- case PARSING_MODE_CFG:
- zend_hash_update(active_hash_table, $1.value.str.val, $1.value.str.len+1, &$3, sizeof(zval), NULL);
- if (active_hash_table == &configuration_hash) {
- zend_alter_ini_entry($1.value.str.val, $1.value.str.len+1, $3.value.str.val, $3.value.str.len+1, PHP_INI_SYSTEM, PHP_INI_STAGE_STARTUP);
- }
- break;
- case PARSING_MODE_STANDALONE: {
- zval *entry;
-
- MAKE_STD_ZVAL(entry);
- entry->value.str.val = estrndup($3.value.str.val, $3.value.str.len);
- entry->value.str.len = $3.value.str.len;
- entry->type = IS_STRING;
- zend_hash_update(active_hash_table, $1.value.str.val, $1.value.str.len+1, &entry, sizeof(zval *), NULL);
- pvalue_config_destructor(&$3);
- }
- break;
- }
- free($1.value.str.val);
- }
- | TC_STRING { free($1.value.str.val); }
- | EXTENSION '=' cfg_string {
- if (parsing_mode==PARSING_MODE_CFG) {
- zval dummy;
-
-#if DEBUG_CFG_PARSER
- printf("Loading '%s'\n",$3.value.str.val);
-#endif
- php_dl(&$3,MODULE_PERSISTENT,&dummy);
- }
- }
- | T_ZEND_EXTENSION '=' cfg_string {
- if (parsing_mode==PARSING_MODE_CFG) {
-#if !defined(ZTS) && !ZEND_DEBUG
- zend_load_extension($3.value.str.val);
-#endif
- free($3.value.str.val);
- }
- }
- | T_ZEND_EXTENSION_TS '=' cfg_string {
- if (parsing_mode==PARSING_MODE_CFG) {
-#if defined(ZTS) && !ZEND_DEBUG
- zend_load_extension($3.value.str.val);
-#endif
- free($3.value.str.val);
- }
- }
- | T_ZEND_EXTENSION_DEBUG '=' cfg_string {
- if (parsing_mode==PARSING_MODE_CFG) {
-#if !defined(ZTS) && ZEND_DEBUG
- zend_load_extension($3.value.str.val);
-#endif
- free($3.value.str.val);
- }
- }
- | T_ZEND_EXTENSION_DEBUG_TS '=' cfg_string {
- if (parsing_mode==PARSING_MODE_CFG) {
-#if defined(ZTS) && ZEND_DEBUG
- zend_load_extension($3.value.str.val);
-#endif
- free($3.value.str.val);
- }
- }
- | SECTION { free($1.value.str.val); }
- | '\n'
-;
-
-
-cfg_string:
- TC_STRING { $$ = $1; }
- | TC_ENCAPSULATED_STRING { $$ = $1; }
-;
-
-string_or_value:
- expr { $$ = $1; }
- | TC_ENCAPSULATED_STRING { $$ = $1; }
- | CFG_TRUE { $$ = $1; }
- | CFG_FALSE { $$ = $1; }
- | '\n' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
- | '\0' { $$.value.str.val = strdup(""); $$.value.str.len=0; $$.type = IS_STRING; }
-;
-
-expr:
- constant_string { $$ = $1; }
- | 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; }
-;
-
-constant_string:
- TC_STRING { do_cfg_get_constant(&$$, &$1); }
-;
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- */
diff --git a/main/configuration-scanner.l b/main/configuration-scanner.l
deleted file mode 100644
index 4e90739d21..0000000000
--- a/main/configuration-scanner.l
+++ /dev/null
@@ -1,182 +0,0 @@
-%{
-
-/*
- +----------------------------------------------------------------------+
- | PHP version 4.0 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Zeev Suraski <zeev@zend.com> |
- +----------------------------------------------------------------------+
-*/
-
-
-#include "php.h"
-#include "configuration-parser.h"
-
-#undef YYSTYPE
-#define YYSTYPE pval
-
-#define YY_DECL cfglex(pval *cfglval)
-
-
-void init_cfg_scanner()
-{
- cfglineno=1;
-}
-
-
-%}
-
-%option noyywrap
-%option yylineno
-
-%%
-
-<INITIAL>"extension" {
-#if 0
- printf("found extension\n");
-#endif
- return EXTENSION;
-}
-
-
-<INITIAL>"zend_extension" {
- return T_ZEND_EXTENSION;
-}
-
-
-<INITIAL>"zend_extension_ts" {
- return T_ZEND_EXTENSION_TS;
-}
-
-
-<INITIAL>"zend_extension_debug" {
- return T_ZEND_EXTENSION_DEBUG;
-}
-
-
-<INITIAL>"zend_extension_debug_ts" {
- return T_ZEND_EXTENSION_DEBUG_TS;
-}
-
-
-<INITIAL>[ ]*("true"|"on"|"yes")[ ]* {
- cfglval->value.str.val = zend_strndup("1",1);
- cfglval->value.str.len = 1;
- cfglval->type = IS_STRING;
- return CFG_TRUE;
-}
-
-
-<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* {
- cfglval->value.str.val = zend_strndup("",0);
- cfglval->value.str.len = 0;
- cfglval->type = IS_STRING;
- return CFG_FALSE;
-}
-
-<INITIAL>[[][^[]+[\]]([\n]?|"\r\n"?) {
- /* SECTION */
-
- /* eat trailng ] */
- while (yyleng>0 && (yytext[yyleng-1]=='\n' || yytext[yyleng-1]=='\r' || yytext[yyleng-1]==']')) {
- yyleng--;
- yytext[yyleng]=0;
- }
-
- /* eat leading [ */
- yytext++;
- yyleng--;
-
- cfglval->value.str.val = zend_strndup(yytext,yyleng);
- cfglval->value.str.len = yyleng;
- cfglval->type = IS_STRING;
- return SECTION;
-}
-
-
-<INITIAL>["][^\n\r"]*["] {
- /* ENCAPSULATED TC_STRING */
-
- /* eat trailing " */
- yytext[yyleng-1]=0;
-
- /* eat leading " */
- yytext++;
-
- cfglval->value.str.val = zend_strndup(yytext, yyleng - 2);
- cfglval->value.str.len = yyleng - 2;
- cfglval->type = IS_STRING;
- return TC_ENCAPSULATED_STRING;
-}
-
-<INITIAL>[&|~()!] {
- return yytext[0];
-}
-
-
-<INITIAL>[^=\n\r\t;|&~()!"]+ {
- /* STRING */
- register int i;
-
- /* eat trailing whitespace */
- for (i=yyleng-1; i>=0; i--) {
- if (yytext[i]==' ' || yytext[i]=='\t') {
- yytext[i]=0;
- yyleng--;
- } else {
- break;
- }
- }
- /* eat leading whitespace */
- while (yytext[0]) {
- if (yytext[0]==' ' || yytext[0]=='\t') {
- yytext++;
- yyleng--;
- } else {
- break;
- }
- }
- if (yyleng!=0) {
- cfglval->value.str.val = zend_strndup(yytext,yyleng);
- cfglval->value.str.len = yyleng;
- cfglval->type = IS_STRING;
- return TC_STRING;
- } else {
- /* whitespace */
- }
-}
-
-
-
-<INITIAL>[=\n] {
- return yytext[0];
-}
-
-<INITIAL>"\r\n" {
- return '\n';
-}
-
-<INITIAL>[;][^\r\n]*[\r\n]? {
- /* comment */
- return '\n';
-}
-
-<INITIAL>[ \t] {
- /* eat whitespace */
-}
-
-<INITIAL>. {
-#if DEBUG
- php_error(E_NOTICE,"Unexpected character on line %d: '%s' (ASCII %d)\n",yylineno,yytext,yytext[0]);
-#endif
-}
diff --git a/main/php_ini.c b/main/php_ini.c
index 1c52a384e5..21afeb54e1 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -20,6 +20,12 @@
#include "php.h"
#include "ext/standard/info.h"
#include "zend_ini.h"
+#include "php_ini.h"
+#include "ext/standard/dl.h"
+#include "zend_extensions.h"
+
+static HashTable configuration_hash;
+PHPAPI extern char *php_ini_path;
static void php_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
@@ -83,3 +89,215 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
php_info_print_table_end();
}
+
+
+/* php.ini support */
+
+#ifdef ZTS
+# if (ZEND_DEBUG)
+# define ZEND_EXTENSION_TOKEN "zend_extension_debug_ts"
+# else
+# define ZEND_EXTENSION_TOKEN "zend_extension_ts"
+# endif
+#else
+# if (ZEND_DEBUG)
+# define ZEND_EXTENSION_TOKEN "zend_extension_debug"
+# else
+# define ZEND_EXTENSION_TOKEN "zend_extension"
+# endif
+#endif
+
+
+static void pvalue_config_destructor(zval *pvalue)
+{
+ if (pvalue->type == IS_STRING && pvalue->value.str.val != empty_string) {
+ free(pvalue->value.str.val);
+ }
+}
+
+
+static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg)
+{
+ switch (callback_type) {
+ case ZEND_INI_PARSER_ENTRY: {
+ zval *entry;
+
+ if (!arg2) {
+ break;
+ }
+ if (!strcasecmp(Z_STRVAL_P(arg1), "extension")) { /* load function module */
+ zval dummy;
+
+ php_dl(arg2, MODULE_PERSISTENT, &dummy);
+ } else if (!strcasecmp(Z_STRVAL_P(arg1), ZEND_EXTENSION_TOKEN)) { /* load Zend extension */
+ zend_load_extension(Z_STRVAL_P(arg2));
+ } else {
+ zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, arg2, sizeof(zval), (void **) &entry);
+ Z_STRVAL_P(entry) = zend_strndup(Z_STRVAL_P(entry), Z_STRLEN_P(entry));
+ php_alter_ini_entry(Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, Z_STRVAL_P(arg2), Z_STRLEN_P(arg2)+1, PHP_INI_SYSTEM, PHP_INI_STAGE_STARTUP);
+ }
+ }
+ break;
+ case ZEND_INI_PARSER_SECTION:
+ break;
+ }
+}
+
+
+int php_init_config(void)
+{
+ PLS_FETCH();
+
+ if (zend_hash_init(&configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1)==FAILURE) {
+ return FAILURE;
+ }
+
+#if USE_CONFIG_FILE
+ {
+ char *env_location,*default_location,*php_ini_search_path;
+ int safe_mode_state = PG(safe_mode);
+ char *open_basedir = PG(open_basedir);
+ char *opened_path;
+ int free_default_location=0;
+ zend_file_handle fh;
+
+ env_location = getenv("PHPRC");
+ if (!env_location) {
+ env_location="";
+ }
+#ifdef PHP_WIN32
+ {
+ if (php_ini_path) {
+ default_location = php_ini_path;
+ } else {
+ default_location = (char *) malloc(512);
+
+ if (!GetWindowsDirectory(default_location,255)) {
+ default_location[0]=0;
+ }
+ free_default_location=1;
+ }
+ }
+#else
+ if (!php_ini_path) {
+ default_location = CONFIGURATION_FILE_PATH;
+ } else {
+ default_location = php_ini_path;
+ }
+#endif
+
+/* build a path */
+ php_ini_search_path = (char *) malloc(sizeof(".")+strlen(env_location)+strlen(default_location)+2+1);
+
+ if (!php_ini_path) {
+#ifdef PHP_WIN32
+ sprintf(php_ini_search_path,".;%s;%s",env_location,default_location);
+#else
+ sprintf(php_ini_search_path,".:%s:%s",env_location,default_location);
+#endif
+ } else {
+ /* if path was set via -c flag, only look there */
+ strcpy(php_ini_search_path,default_location);
+ }
+ PG(safe_mode) = 0;
+ PG(open_basedir) = NULL;
+
+
+ fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &opened_path);
+ free(php_ini_search_path);
+ if (free_default_location) {
+ free(default_location);
+ }
+ PG(safe_mode) = safe_mode_state;
+ PG(open_basedir) = open_basedir;
+
+ if (!fh.handle.fp) {
+ return SUCCESS; /* having no configuration file is ok */
+ }
+ fh.type = ZEND_HANDLE_FP;
+ fh.filename = opened_path;
+
+ zend_parse_ini_file(&fh, 1, php_config_ini_parser_cb, NULL);
+
+ if (opened_path) {
+ zval tmp;
+
+ tmp.value.str.val = strdup(opened_path);
+ tmp.value.str.len = strlen(opened_path);
+ tmp.type = IS_STRING;
+ zend_hash_update(&configuration_hash,"cfg_file_path",sizeof("cfg_file_path"),(void *) &tmp,sizeof(zval),NULL);
+#if DEBUG_CFG_PARSER
+ php_printf("INI file opened at '%s'\n",opened_path);
+#endif
+ efree(opened_path);
+ }
+ }
+
+#endif
+
+ return SUCCESS;
+}
+
+
+int php_shutdown_config(void)
+{
+ zend_hash_destroy(&configuration_hash);
+ return SUCCESS;
+}
+
+
+zval *cfg_get_entry(char *name, uint name_length)
+{
+ zval *tmp;
+
+ if (zend_hash_find(&configuration_hash, name, name_length, (void **) &tmp)==SUCCESS) {
+ return tmp;
+ } else {
+ return NULL;
+ }
+}
+
+
+PHPAPI int cfg_get_long(char *varname,long *result)
+{
+ zval *tmp,var;
+
+ if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ *result=(long)NULL;
+ return FAILURE;
+ }
+ var = *tmp;
+ zval_copy_ctor(&var);
+ convert_to_long(&var);
+ *result = var.value.lval;
+ return SUCCESS;
+}
+
+
+PHPAPI int cfg_get_double(char *varname,double *result)
+{
+ zval *tmp,var;
+
+ if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ *result=(double)0;
+ return FAILURE;
+ }
+ var = *tmp;
+ zval_copy_ctor(&var);
+ convert_to_double(&var);
+ *result = var.value.dval;
+ return SUCCESS;
+}
+
+
+PHPAPI int cfg_get_string(char *varname, char **result)
+{
+ zval *tmp;
+
+ if (zend_hash_find(&configuration_hash,varname,strlen(varname)+1,(void **) &tmp)==FAILURE) {
+ *result=NULL;
+ return FAILURE;
+ }
+ *result = tmp->value.str.val;
+ return SUCCESS;
+}
diff --git a/main/php_ini.h b/main/php_ini.h
index 0321c1fa68..cd1b2b00a6 100644
--- a/main/php_ini.h
+++ b/main/php_ini.h
@@ -21,6 +21,9 @@
#include "zend_ini.h"
+int php_init_config(void);
+int php_shutdown_config(void);
+
#define PHP_INI_USER ZEND_INI_USER
#define PHP_INI_PERDIR ZEND_INI_PERDIR
#define PHP_INI_SYSTEM ZEND_INI_SYSTEM
diff --git a/main/php_main.h b/main/php_main.h
index 22b1bbc8c4..09ec56d0cb 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -49,11 +49,6 @@ PHPAPI int php_handle_auth_data(const char *auth SLS_DC);
extern void php_call_shutdown_functions(void);
-
-/* configuration module */
-extern int php_init_config(void);
-extern int php_shutdown_config(void);
-
/* environment module */
extern int php_init_environ(void);
extern int php_shutdown_environ(void);
diff --git a/win32/php4.dsp b/win32/php4.dsp
index c21a8d1b55..2ac2aa056a 100644
--- a/win32/php4.dsp
+++ b/win32/php4.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -68,7 +68,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D ZEND_DEBUG=1 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "DEBUG" /D "_DEBUG" /D "_CONSOLE" /D ZEND_DEBUG=1 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i "c:\include" /d "_DEBUG"
@@ -96,7 +96,7 @@ LINK32=link.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex\\" /I "..\bindlib_w32" /D "NDEBUG" /D "MSVC5" /D "_CONSOLE" /D "WIN32" /D "_MBCS" /D ZEND_DEBUG=0 /Fr /FD /c
# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex\\" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_CONSOLE" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /Fr /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
diff --git a/win32/php4.dsw b/win32/php4.dsw
index 1dd2dbe6dd..25e42c8a46 100644
--- a/win32/php4.dsw
+++ b/win32/php4.dsw
@@ -3,6 +3,18 @@ Microsoft Developer Studio Workspace File, Format Version 6.00
###############################################################################
+Project: "TSRM"=..\TSRM\TSRM.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "Zend"=..\Zend\Zend.dsp - Package Owner=<4>
Package=<5>
@@ -56,6 +68,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name libmysql
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name TSRM
+ End Project Dependency
}}}
###############################################################################
diff --git a/win32/php4dll.dsp b/win32/php4dll.dsp
index ed421862d2..dc74d81499 100644
--- a/win32/php4dll.dsp
+++ b/win32/php4dll.dsp
@@ -44,7 +44,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=1 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40d /d "_DEBUG"
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib libmysql.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"..\Debug\php4nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib wsock32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Zend.lib resolv.lib libmysql.lib TSRM.lib /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"..\Debug\php4nts_debug.dll" /pdbtype:sept /libpath:"..\TSRM\Debug_TS" /libpath:"..\Zend\Debug" /libpath:"..\..\bindlib_w32\Debug" /libpath:"..\ext\mysql\libmysql\Debug"
!ELSEIF "$(CFG)" == "php4dll - Win32 Release"
@@ -70,7 +70,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLL_EXPORTS" /D "PHP_EXPORTS" /D "SAPI_EXPORTS" /D "LIBZEND_EXPORTS" /D ZEND_DEBUG=0 /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40d /d "NDEBUG"
@@ -97,7 +97,7 @@ LINK32=link.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /D "MSVC5" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D ZEND_DEBUG=0 /D "TSRM_EXPORTS" /D "WIN32" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /I "main" /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "Zend" /I "." /I "regex" /I "..\bindlib_w32" /I "main" /I ".." /I "..\main" /I "..\Zend" /I "..\regex" /I "..\..\bindlib_w32" /I "..\TSRM" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PHP4DLLTS_EXPORTS" /D "PHP_EXPORTS" /D "LIBZEND_EXPORTS" /D "SAPI_EXPORTS" /D "TSRM_EXPORTS" /D ZEND_DEBUG=0 /D "ZEND_WIN32_FORCE_INLINE" /D "MSVC5" /D "WIN32" /D "_MBCS" /D "ZEND_WIN32" /D "PHP_WIN32" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40d /d "NDEBUG"
@@ -124,14 +124,6 @@ LINK32=link.exe
# PROP Default_Filter ""
# Begin Source File
-SOURCE="..\main\configuration-parser.c"
-# End Source File
-# Begin Source File
-
-SOURCE="..\main\configuration-scanner.c"
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\cyr_convert.c
# End Source File
# Begin Source File
@@ -153,6 +145,10 @@ SOURCE=..\main\mergesort.c
# End Source File
# Begin Source File
+SOURCE=..\main\network.c
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\standard\output.c
# End Source File
# Begin Source File
@@ -165,15 +161,15 @@ SOURCE=..\main\php_ini.c
# End Source File
# Begin Source File
-SOURCE=..\main\php_ticks.c
+SOURCE=..\main\php_open_temporary_file.c
# End Source File
# Begin Source File
-SOURCE=..\main\php_variables.c
+SOURCE=..\main\php_ticks.c
# End Source File
# Begin Source File
-SOURCE=..\main\php_virtual_cwd.c
+SOURCE=..\main\php_variables.c
# End Source File
# Begin Source File
@@ -213,10 +209,6 @@ SOURCE=..\main\config.w32.h
# End Source File
# Begin Source File
-SOURCE="..\main\configuration-parser.h"
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\cyr_convert.h
# End Source File
# Begin Source File
@@ -261,19 +253,19 @@ SOURCE=..\main\php_ini.h
# End Source File
# Begin Source File
-SOURCE=..\main\php_realpath.h
+SOURCE=..\main\php_open_temporary_file.h
# End Source File
# Begin Source File
-SOURCE=..\main\php_ticks.h
+SOURCE=..\main\php_realpath.h
# End Source File
# Begin Source File
-SOURCE=..\main\php_variables.h
+SOURCE=..\main\php_ticks.h
# End Source File
# Begin Source File
-SOURCE=..\main\php_virtual_cwd.h
+SOURCE=..\main\php_variables.h
# End Source File
# Begin Source File
@@ -373,6 +365,10 @@ SOURCE=..\ext\standard\fsock.c
# End Source File
# Begin Source File
+SOURCE=..\ext\standard\ftp_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\standard\head.c
# End Source File
# Begin Source File
@@ -381,6 +377,10 @@ SOURCE=..\ext\standard\html.c
# End Source File
# Begin Source File
+SOURCE=..\ext\standard\http_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\standard\image.c
# End Source File
# Begin Source File
@@ -453,6 +453,10 @@ SOURCE=..\ext\standard\parsedate.c
# End Source File
# Begin Source File
+SOURCE=..\ext\standard\php_fopen_wrapper.c
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\mysql\php_mysql.c
# ADD CPP /I "..\ext\mysql\libmysql"
# End Source File
@@ -521,6 +525,14 @@ SOURCE=..\ext\standard\url.c
# End Source File
# Begin Source File
+SOURCE=..\ext\standard\url_scanner.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.c
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\standard\var.c
# End Source File
# End Group
@@ -609,6 +621,10 @@ SOURCE=..\ext\standard\php_filestat.h
# End Source File
# Begin Source File
+SOURCE=..\ext\standard\php_fopen_wrappers.h
+# End Source File
+# Begin Source File
+
SOURCE=..\ext\ldap\php_ldap.h
# End Source File
# Begin Source File
@@ -667,6 +683,14 @@ SOURCE=..\ext\standard\uniqid.h
SOURCE=..\ext\standard\url.h
# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\standard\url_scanner_ex.h
+# End Source File
# End Group
# Begin Group "Regular Expressions"
@@ -887,6 +911,86 @@ SOURCE=..\ext\xml\expat\xmltok\xmltok_ns.c
# End Group
# End Group
# End Group
+# Begin Group "FTP"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 6"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 6"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\ftp\ftp.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\ftp\php_ftp.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "Calendar"
+
+# PROP Default_Filter ""
+# Begin Group "Source Files No. 7"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=..\ext\calendar\cal_unix.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\calendar.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\dow.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\easter.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\french.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\gregor.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\jewish.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\julian.c
+# End Source File
+# End Group
+# Begin Group "Header Files No. 7"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=..\ext\calendar\php_calendar.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\ext\calendar\sdncal.h
+# End Source File
+# End Group
+# End Group
# End Group
# Begin Group "Win32"
@@ -989,67 +1093,6 @@ SOURCE=..\win32\wfile.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE="..\main\configuration-parser.y"
-
-!IF "$(CFG)" == "php4dll - Win32 Debug"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dll - Win32 Release"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dll - Win32 Release_inline"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\parsedate.y
!IF "$(CFG)" == "php4dll - Win32 Debug"
@@ -1095,46 +1138,6 @@ InputPath=..\ext\standard\parsedate.y
# Begin Group "Scanners"
# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE="..\main\configuration-scanner.l"
-
-!IF "$(CFG)" == "php4dll - Win32 Debug"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dll - Win32 Release"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dll - Win32 Release_inline"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
# End Group
# Begin Group "Text Files"
diff --git a/win32/php4dllts.dsp b/win32/php4dllts.dsp
index 6d57671747..4813a12c03 100644
--- a/win32/php4dllts.dsp
+++ b/win32/php4dllts.dsp
@@ -124,14 +124,6 @@ LINK32=link.exe
# PROP Default_Filter ""
# Begin Source File
-SOURCE="..\main\configuration-parser.c"
-# End Source File
-# Begin Source File
-
-SOURCE="..\main\configuration-scanner.c"
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\cyr_convert.c
# End Source File
# Begin Source File
@@ -213,10 +205,6 @@ SOURCE=..\main\config.w32.h
# End Source File
# Begin Source File
-SOURCE="..\main\configuration-parser.h"
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\cyr_convert.h
# End Source File
# Begin Source File
@@ -237,10 +225,6 @@ SOURCE=..\main\logos.h
# End Source File
# Begin Source File
-SOURCE=..\main\main.h
-# End Source File
-# Begin Source File
-
SOURCE=..\main\output.h
# End Source File
# Begin Source File
@@ -269,6 +253,10 @@ SOURCE=..\main\php_ini.h
# End Source File
# Begin Source File
+SOURCE=..\main\php_main.h
+# End Source File
+# Begin Source File
+
SOURCE=..\main\php_open_temporary_file.h
# End Source File
# Begin Source File
@@ -1108,67 +1096,6 @@ SOURCE=..\win32\wfile.h
# PROP Default_Filter ""
# Begin Source File
-SOURCE="..\main\configuration-parser.y"
-
-!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputPath="..\main\configuration-parser.y"
-
-BuildCmds= \
- cd ..\main \
- if not "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "%CYGWIN%\share\bison.simple" -p cfg configuration-parser.y \
- if "X%CYGWIN%"=="X" bison --output=configuration-parser.c -v -d -S "C:\Program Files\Cygnus\share\bison.simple" -p cfg configuration-parser.y \
-
-
-"..\main\configuration-parser.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-
-"..\main\configuration-parser.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- $(BuildCmds)
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
SOURCE=..\ext\standard\parsedate.y
!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"
@@ -1214,46 +1141,6 @@ InputPath=..\ext\standard\parsedate.y
# Begin Group "Scanners"
# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE="..\main\configuration-scanner.l"
-
-!IF "$(CFG)" == "php4dllts - Win32 Debug_TS"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "php4dllts - Win32 Release_TS_inline"
-
-# Begin Custom Build
-InputPath="..\main\configuration-scanner.l"
-
-"..\main\configuration-scanner.c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- cd ..\main
- flex -i -Pcfg -oconfiguration-scanner.c configuration-scanner.l
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
# End Group
# Begin Group "Text Files"