#define YYSTYPE zval
-#define PARSING_MODE_CFG 0
-#define PARSING_MODE_BROWSCAP 1
+#define PARSING_MODE_CFG 0
+#define PARSING_MODE_BROWSCAP 1
+#define PARSING_MODE_STANDALONE 2
static HashTable configuration_hash;
extern HashTable browser_hash;
}
+PHP_FUNCTION(parse_ini_file)
+{
+#if ZTS
+ php_error(E_WARNING, "parse_ini_file() is not supported in multithreaded PHP");
+ RETURN_FALSE;
+#else
+ zval **filename;
+
+ if (ARG_COUNT(ht)!=1 || zend_get_parameters_ex(1, &filename)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_string_ex(filename);
+ cfgin = fopen((*filename)->value.str.val, "r");
+ if (!cfgin) {
+ php_error(E_WARNING,"Cannot open '%s' for reading", (*filename)->value.str.val);
+ return FAILURE;
+ }
+ array_init(return_value);
+ init_cfg_scanner();
+ active_hash_table = return_value->value.ht;
+ parsing_mode = PARSING_MODE_STANDALONE;
+ currently_parsed_filename = (*filename)->value.str.val;
+ yyparse();
+ fclose(cfgin);
+#endif
+}
+
+
int php_shutdown_config(void)
{
zend_hash_destroy(&configuration_hash);
printf("'%s' = '%s'\n",$1.value.str.val,$3.value.str.val);
#endif
$3.type = IS_STRING;
- if (parsing_mode==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) {
- php_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);
- }
- } else if (parsing_mode==PARSING_MODE_BROWSCAP) {
- if (current_section) {
- zval *new_property;
-
- new_property = (zval *) malloc(sizeof(zval));
- INIT_PZVAL(new_property);
- new_property->value.str.val = $3.value.str.val;
- new_property->value.str.len = $3.value.str.len;
- new_property->type = IS_STRING;
- zend_str_tolower(new_property->value.str.val, new_property->value.str.len);
- zend_hash_update(current_section->value.obj.properties, $1.value.str.val, $1.value.str.len+1, &new_property, sizeof(zval *), NULL);
- }
- }
+ 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) {
+ php_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_BROWSCAP:
+ if (current_section) {
+ zval *new_property;
+
+ new_property = (zval *) malloc(sizeof(zval));
+ INIT_PZVAL(new_property);
+ new_property->value.str.val = $3.value.str.val;
+ new_property->value.str.len = $3.value.str.len;
+ new_property->type = IS_STRING;
+ zend_str_tolower(new_property->value.str.val, new_property->value.str.len);
+ zend_hash_update(current_section->value.obj.properties, $1.value.str.val, $1.value.str.len+1, &new_property, sizeof(zval *), NULL);
+ }
+ 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); }
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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\r
-# 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 /nologo /dll /debug /machine:I386 /nodefaultlib:"libcmt" /nodefaultlib:"libc" /nodefaultlib:"libcmtd" /out:"Debug/php4nts.dll" /pdbtype:sept /libpath:"TSRM\Debug" /libpath:"Zend\Debug" /libpath:"..\bindlib_w32\Debug"\r
+# 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.dll" /pdbtype:sept /libpath:"TSRM\Debug" /libpath:"Zend\Debug" /libpath:"..\bindlib_w32\Debug" /libpath:"ext\mysql\libmysql\Debug_TS"\r
\r
!ELSEIF "$(CFG)" == "php4dll - Win32 Release"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# 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 /machine:I386\r
-# 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 /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php4nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"\r
+# 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 /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php4nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release" /libpath:"ext\mysql\libmysql\Release_TS"\r
\r
!ELSEIF "$(CFG)" == "php4dll - Win32 Release_inline"\r
\r
# ADD BSC32 /nologo\r
LINK32=link.exe\r
# ADD BASE 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 /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php4nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"\r
-# 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 /nologo /dll /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php4nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"\r
+# 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 /machine:I386 /nodefaultlib:"libc.lib" /out:"Release/php4nts.dll" /libpath:"TSRM\Release" /libpath:"Zend\Release" /libpath:"..\bindlib_w32\Release"\r
\r
!ENDIF \r
\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=.\php_ticks.c\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=.\php_variables.c\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=.\php_ticks.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=.\php_variables.h\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=.\ext\mysql\php_mysql.c\r
+# ADD CPP /I "ext\mysql\libmysql"\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=.\ext\odbc\php_odbc.c\r
# End Source File\r
# Begin Source File\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=.\ext\mysql\php_mysql.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=.\ext\odbc\php_odbc.h\r
# End Source File\r
# Begin Source File\r