]> granicus.if.org Git - php/commitdiff
* Add a new workspace for dynamic PHP extensions.
authorZeev Suraski <zeev@php.net>
Fri, 4 Jun 1999 10:45:54 +0000 (10:45 +0000)
committerZeev Suraski <zeev@php.net>
Fri, 4 Jun 1999 10:45:54 +0000 (10:45 +0000)
* Add a few functions to PHP's API.
* Get the MySQL extension up-to-date and thread safe.
* Add a project for building the MySQL extension under Win32.

ext/mysql/Readme_w32.txt [new file with mode: 0644]
ext/mysql/mysql.c
ext/mysql/mysql.dsp [new file with mode: 0644]
ext/mysql/php3_mysql.h
main/config.w32.h
main/php.h
main/php_globals.h
main/php_ini.c
main/php_ini.h
php4ext.dsw [new file with mode: 0644]

diff --git a/ext/mysql/Readme_w32.txt b/ext/mysql/Readme_w32.txt
new file mode 100644 (file)
index 0000000..4f4e225
--- /dev/null
@@ -0,0 +1,14 @@
+MySQL Extension for PHP 4.0 - Win32 README
+------------------------------------------
+
+In order to compile this extension, MySQL must be installed in a parrallel directory
+to that of PHP 4.0.  For example, if you have PHP 4.0's source tree set up in
+C:\Projects\php4, you must have MySQL set up in C:\Projects\MySQL.  The compiler
+will look for include files in C:\Projects\MySQL\include and for the library
+files in C:\Projects\MySQL\lib.
+
+You can change this by editing the project settings, but it's not recommended, since
+you will have to do it every time you obtain a new version of the PHP 4.0 source tree.
+
+
+[4/6/1999 zeev@zend.com]
\ No newline at end of file
index d68f4c9b6ce496175d08526866d14d7de30605f2..d632b3481bcf910ee4dce36e9b1d7007c84af982 100644 (file)
  */
 
 #if COMPILE_DL
-# if PHP_31
-#  include "../phpdl.h"
-# else
-#  include "dl/phpdl.h"
-# endif
+#include "dl/phpdl.h"
 #endif
 
 #include "php.h"
 #include "php_globals.h"
 #include "ext/standard/php3_standard.h"
 #include "php3_mysql.h"
+#include "php_globals.h"
 
 
 #if WIN32|WINNT
@@ -151,7 +148,7 @@ php3_module_entry mysql_module_entry = {
 #ifdef ZTS
 int mysql_globals_id;
 #else
-php_mysql_globals mysql_globals;
+PHP_MYSQL_API php_mysql_globals mysql_globals;
 #endif
 
 #ifdef COMPILE_DL
@@ -277,7 +274,7 @@ static void php_mysql_init_globals(php_mysql_globals *mysql_globals)
 int php3_minit_mysql(INIT_FUNC_ARGS)
 {
 #ifdef ZTS
-       mysql_globals_id = tsrm_allocate_id(sizeof(php_mysql_globals), php_mysql_init_globals, NULL);
+       mysql_globals_id = ts_allocate_id(sizeof(php_mysql_globals), php_mysql_init_globals, NULL);
 #else
        MySG(num_persistent)=0;
 #endif
@@ -359,6 +356,7 @@ static void php3_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
        int hashed_details_length,port;
        MYSQL *mysql;
        MySLS_FETCH();
+       PLS_FETCH();
 
        if (PG(sql_safe_mode)) {
                if (ARG_COUNT(ht)>0) {
@@ -598,6 +596,7 @@ static int php3_mysql_get_default_link(INTERNAL_FUNCTION_PARAMETERS MySLS_DC)
        return MySG(default_link);
 }
 
+
 /* {{{ proto int mysql_connect([string hostname[:port]] [, string username] [, string password])
    Open a connection to a MySQL Server */
 PHP_FUNCTION(mysql_connect)
@@ -606,6 +605,7 @@ PHP_FUNCTION(mysql_connect)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_pconnect([string hostname[:port]] [, string username] [, string password])
    Open a persistent connection to a MySQL Server */
 PHP_FUNCTION(mysql_pconnect)
@@ -614,6 +614,7 @@ PHP_FUNCTION(mysql_pconnect)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_close([int link_identifier])
    Close a MySQL connection */
 PHP_FUNCTION(mysql_close)
@@ -621,6 +622,7 @@ PHP_FUNCTION(mysql_close)
        pval *mysql_link;
        int id,type;
        MYSQL *mysql;
+       MySLS_FETCH();
 
        switch (ARG_COUNT(ht)) {
                case 0:
@@ -649,6 +651,7 @@ PHP_FUNCTION(mysql_close)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_select_db(string database_name [, int link_identifier])
    Select a MySQL database */
 PHP_FUNCTION(mysql_select_db)
@@ -656,7 +659,7 @@ PHP_FUNCTION(mysql_select_db)
        pval *db,*mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 1:
@@ -695,6 +698,7 @@ PHP_FUNCTION(mysql_select_db)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_create_db(string database_name [, int link_identifier])
    Create a MySQL database */
 PHP_FUNCTION(mysql_create_db)
@@ -702,7 +706,7 @@ PHP_FUNCTION(mysql_create_db)
        pval *db,*mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 1:
@@ -740,6 +744,7 @@ PHP_FUNCTION(mysql_create_db)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_drop_db(string database_name [, int link_identifier])
    Drop (delete) a MySQL database */
 PHP_FUNCTION(mysql_drop_db)
@@ -747,7 +752,7 @@ PHP_FUNCTION(mysql_drop_db)
        pval *db,*mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 1:
@@ -785,6 +790,7 @@ PHP_FUNCTION(mysql_drop_db)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_query(string query [, int link_identifier])
    Send an SQL query to MySQL */
 PHP_FUNCTION(mysql_query)
@@ -793,7 +799,7 @@ PHP_FUNCTION(mysql_query)
        int id,type;
        MYSQL *mysql;
        MYSQL_RES *mysql_result;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 1:
@@ -842,6 +848,7 @@ PHP_FUNCTION(mysql_query)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_db_query(string database_name, string query [, int link_identifier])
    Send an SQL query to MySQL */
 PHP_FUNCTION(mysql_db_query)
@@ -850,7 +857,7 @@ PHP_FUNCTION(mysql_db_query)
        int id,type;
        MYSQL *mysql;
        MYSQL_RES *mysql_result;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 2:
@@ -907,6 +914,7 @@ PHP_FUNCTION(mysql_db_query)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_list_dbs([int link_identifier])
    List databases available on a MySQL server */
 PHP_FUNCTION(mysql_list_dbs)
@@ -915,7 +923,7 @@ PHP_FUNCTION(mysql_list_dbs)
        int id,type;
        MYSQL *mysql;
        MYSQL_RES *mysql_result;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 0:
@@ -949,6 +957,7 @@ PHP_FUNCTION(mysql_list_dbs)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_list_tables(string database_name [, int link_identifier])
    List tables in a MySQL database */
 PHP_FUNCTION(mysql_list_tables)
@@ -957,7 +966,7 @@ PHP_FUNCTION(mysql_list_tables)
        int id,type;
        MYSQL *mysql;
        MYSQL_RES *mysql_result;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 1:
@@ -999,6 +1008,7 @@ PHP_FUNCTION(mysql_list_tables)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_list_fields(string database_name, string table_name [, int link_identifier])
    List MySQL result fields */
 PHP_FUNCTION(mysql_list_fields)
@@ -1007,7 +1017,7 @@ PHP_FUNCTION(mysql_list_fields)
        int id,type;
        MYSQL *mysql;
        MYSQL_RES *mysql_result;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 2:
@@ -1050,6 +1060,7 @@ PHP_FUNCTION(mysql_list_fields)
 }
 /* }}} */
 
+
 /* {{{ proto string mysql_error([int link_identifier])
    Returns the text of the error message from previous MySQL operation */
 PHP_FUNCTION(mysql_error)
@@ -1057,7 +1068,7 @@ PHP_FUNCTION(mysql_error)
        pval *mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 0:
@@ -1088,6 +1099,7 @@ PHP_FUNCTION(mysql_error)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_errno([int link_identifier])
    Returns the number of the error message from previous MySQL operation */
 #ifdef mysql_errno
@@ -1096,7 +1108,7 @@ PHP_FUNCTION(mysql_errno)
        pval *mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 0:
@@ -1128,6 +1140,7 @@ PHP_FUNCTION(mysql_errno)
 #endif
 /* }}} */
 
+
 /* {{{ proto int mysql_affected_rows([int link_identifier])
    Get number of affected rows in previous MySQL operation */
 PHP_FUNCTION(mysql_affected_rows)
@@ -1135,7 +1148,7 @@ PHP_FUNCTION(mysql_affected_rows)
        pval *mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 0:
@@ -1165,6 +1178,7 @@ PHP_FUNCTION(mysql_affected_rows)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_insert_id([int link_identifier])
    Get the id generated from the previous INSERT operation */
 PHP_FUNCTION(mysql_insert_id)
@@ -1172,7 +1186,7 @@ PHP_FUNCTION(mysql_insert_id)
        pval *mysql_link;
        int id,type;
        MYSQL *mysql;
-
+       MySLS_FETCH();
        
        switch(ARG_COUNT(ht)) {
                case 0:
@@ -1202,6 +1216,7 @@ PHP_FUNCTION(mysql_insert_id)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_result(int result, int row [, mixed field])
    Get result data */
 PHP_FUNCTION(mysql_result)
@@ -1314,6 +1329,7 @@ PHP_FUNCTION(mysql_result)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_num_rows(int result)
    Get number of rows in a result */
 PHP_FUNCTION(mysql_num_rows)
@@ -1367,6 +1383,7 @@ PHP_FUNCTION(mysql_num_fields)
 }
 /* }}} */
 
+
 /* {{{ proto array mysql_fetch_row(int result)
    Get a result row as an enumerated array */
 PHP_FUNCTION(mysql_fetch_row)
@@ -1419,6 +1436,7 @@ PHP_FUNCTION(mysql_fetch_row)
 }
 /* }}} */
 
+
 static PHP_FUNCTION(mysql_fetch_hash)
 {
        pval *result;
@@ -1474,6 +1492,7 @@ static PHP_FUNCTION(mysql_fetch_hash)
        }
 }
 
+
 /* {{{ proto object mysql_fetch_object(int result)
    Fetch a result row as an object */
 PHP_FUNCTION(mysql_fetch_object)
@@ -1482,11 +1501,12 @@ PHP_FUNCTION(mysql_fetch_object)
        if (return_value->type==IS_ARRAY) {
                return_value->type=IS_OBJECT;
                return_value->value.obj.properties = return_value->value.ht;
-               return_value->value.obj.ce = &standard_class;
+               return_value->value.obj.ce = &zend_standard_class_def;
        }
 }
 /* }}} */
 
+
 /* {{{ proto array mysql_fetch_array(int result)
    Fetch a result row as an associative array */
 PHP_FUNCTION(mysql_fetch_array)
@@ -1495,6 +1515,7 @@ PHP_FUNCTION(mysql_fetch_array)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_data_seek(int result, int row_number)
    Move internal result pointer */
 PHP_FUNCTION(mysql_data_seek)
@@ -1525,6 +1546,7 @@ PHP_FUNCTION(mysql_data_seek)
 }
 /* }}} */
 
+
 /* {{{ proto array mysql_fetch_lengths(int result)
    Get max data size of each column in a result */
 PHP_FUNCTION(mysql_fetch_lengths)
@@ -1562,6 +1584,7 @@ PHP_FUNCTION(mysql_fetch_lengths)
 }
 /* }}} */
 
+
 static char *php3_mysql_get_field_name(int field_type)
 {
        switch(field_type) {
@@ -1610,6 +1633,7 @@ static char *php3_mysql_get_field_name(int field_type)
        }
 }
 
+
 /* {{{ proto object mysql_fetch_field(int result [, int field_offset])
    Get column information from a result and return as an object */
 PHP_FUNCTION(mysql_fetch_field)
@@ -1673,6 +1697,7 @@ PHP_FUNCTION(mysql_fetch_field)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_field_seek(int result, int field_offset)
    Set result pointer to a specific field offset */
 PHP_FUNCTION(mysql_field_seek)
@@ -1703,12 +1728,14 @@ PHP_FUNCTION(mysql_field_seek)
 }
 /* }}} */
 
+
 #define PHP3_MYSQL_FIELD_NAME 1
 #define PHP3_MYSQL_FIELD_TABLE 2
 #define PHP3_MYSQL_FIELD_LEN 3
 #define PHP3_MYSQL_FIELD_TYPE 4
 #define PHP3_MYSQL_FIELD_FLAGS 5
  
+
 static void php3_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
 {
        pval *result, *field;
@@ -1835,6 +1862,7 @@ static void php3_mysql_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
        }
 }
 
+
 /* {{{ proto string mysql_field_name(int result, int field_index)
    Get the name of the specified field in a result */
 PHP_FUNCTION(mysql_field_name)
@@ -1843,6 +1871,7 @@ PHP_FUNCTION(mysql_field_name)
 }
 /* }}} */
 
+
 /* {{{ proto string mysql_field_table(int result, int field_offset)
    Get name of the table the specified field is in */
 PHP_FUNCTION(mysql_field_table)
@@ -1851,6 +1880,7 @@ PHP_FUNCTION(mysql_field_table)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_field_len(int result, int field_offet)
    Returns the length of the specified field */
 PHP_FUNCTION(mysql_field_len)
@@ -1859,6 +1889,7 @@ PHP_FUNCTION(mysql_field_len)
 }
 /* }}} */
 
+
 /* {{{ proto string mysql_field_type(int result, int field_offset)
    Get the type of the specified field in a result */
 PHP_FUNCTION(mysql_field_type)
@@ -1867,6 +1898,7 @@ PHP_FUNCTION(mysql_field_type)
 }
 /* }}} */
 
+
 /* {{{ proto string mysql_field_flags(int result, int field_offset)
    Get the flags associated with the specified field in a result */
 PHP_FUNCTION(mysql_field_flags)
@@ -1875,6 +1907,7 @@ PHP_FUNCTION(mysql_field_flags)
 }
 /* }}} */
 
+
 /* {{{ proto int mysql_free_result(int result)
    Free result memory */
 PHP_FUNCTION(mysql_free_result)
diff --git a/ext/mysql/mysql.dsp b/ext/mysql/mysql.dsp
new file mode 100644 (file)
index 0000000..0305861
--- /dev/null
@@ -0,0 +1,171 @@
+# Microsoft Developer Studio Project File - Name="mysql" - Package Owner=<4>\r
+# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
+# ** DO NOT EDIT **\r
+\r
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
+\r
+CFG=mysql - Win32 Debug_TS\r
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
+!MESSAGE use the Export Makefile command and run\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "mysql.mak".\r
+!MESSAGE \r
+!MESSAGE You can specify a configuration when running NMAKE\r
+!MESSAGE by defining the macro CFG on the command line. For example:\r
+!MESSAGE \r
+!MESSAGE NMAKE /f "mysql.mak" CFG="mysql - Win32 Debug_TS"\r
+!MESSAGE \r
+!MESSAGE Possible choices for configuration are:\r
+!MESSAGE \r
+!MESSAGE "mysql - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "mysql - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "mysql - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE "mysql - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
+!MESSAGE \r
+\r
+# Begin Project\r
+# PROP AllowPerConfigDependencies 0\r
+# PROP Scc_ProjName ""\r
+# PROP Scc_LocalPath ""\r
+CPP=cl.exe\r
+MTL=midl.exe\r
+RSC=rc.exe\r
+\r
+!IF  "$(CFG)" == "mysql - Win32 Release"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release"\r
+# PROP BASE Intermediate_Dir "Release"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release"\r
+# PROP Intermediate_Dir "Release"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /c\r
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /YX /FD /c\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x40d /d "NDEBUG"\r
+# ADD RSC /l 0x40d /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\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 winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php4nts.lib /nologo /dll /machine:I386 /out:"Release/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release"\r
+\r
+!ELSEIF  "$(CFG)" == "mysql - Win32 Debug"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug"\r
+# PROP BASE Intermediate_Dir "Debug"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug"\r
+# PROP Intermediate_Dir "Debug"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /YX /FD /GZ  /c\r
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\..\TSRM" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /D ZEND_DEBUG=1 /FR /YX /FD /GZ  /c\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x40d /d "_DEBUG"\r
+# ADD RSC /l 0x40d /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\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 /debug /machine:I386 /pdbtype:sept\r
+# ADD 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 libmySQL.lib php4nts.lib /nologo /dll /debug /machine:I386 /out:"Debug/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\debug" /libpath:"..\..\Debug"\r
+\r
+!ELSEIF  "$(CFG)" == "mysql - Win32 Debug_TS"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 1\r
+# PROP BASE Output_Dir "Debug_TS"\r
+# PROP BASE Intermediate_Dir "Debug_TS"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 1\r
+# PROP Output_Dir "Debug_TS"\r
+# PROP Intermediate_Dir "Debug_TS"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /FR /YX /FD /GZ  /c\r
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\..\TSRM" /D "_DEBUG" /D ZEND_DEBUG=1 /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /D "ZTS" /FR /YX /FD /GZ  /c\r
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x40d /d "_DEBUG"\r
+# ADD RSC /l 0x40d /d "_DEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\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 /debug /machine:I386 /pdbtype:sept\r
+# ADD 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 libmySQL.lib php4ts.lib /nologo /dll /debug /machine:I386 /out:"Debug_TS/php_mysql.dll" /pdbtype:sept /libpath:"..\..\..\MySQL\lib\debug" /libpath:"..\..\Debug_TS"\r
+\r
+!ELSEIF  "$(CFG)" == "mysql - Win32 Release_TS"\r
+\r
+# PROP BASE Use_MFC 0\r
+# PROP BASE Use_Debug_Libraries 0\r
+# PROP BASE Output_Dir "Release_TS"\r
+# PROP BASE Intermediate_Dir "Release_TS"\r
+# PROP BASE Target_Dir ""\r
+# PROP Use_MFC 0\r
+# PROP Use_Debug_Libraries 0\r
+# PROP Output_Dir "Release_TS"\r
+# PROP Intermediate_Dir "Release_TS"\r
+# PROP Ignore_Export_Lib 0\r
+# PROP Target_Dir ""\r
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /YX /FD /c\r
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\libzend" /I "..\..\..\bindlib_w32" /I "..\..\..\MySQL\include" /I "..\..\..\TSRM" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MYSQL_EXPORTS" /D "COMPILE_DL" /D HAVE_MYSQL=1 /D "ZTS" /YX /FD /c\r
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
+# ADD BASE RSC /l 0x40d /d "NDEBUG"\r
+# ADD RSC /l 0x40d /d "NDEBUG"\r
+BSC32=bscmake.exe\r
+# ADD BASE BSC32 /nologo\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 winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php4ts.lib /nologo /dll /machine:I386 /out:"Release_TS/php_mysql.dll" /libpath:"..\..\..\MySQL\lib\opt" /libpath:"..\..\Release_TS"\r
+\r
+!ENDIF \r
+\r
+# Begin Target\r
+\r
+# Name "mysql - Win32 Release"\r
+# Name "mysql - Win32 Debug"\r
+# Name "mysql - Win32 Debug_TS"\r
+# Name "mysql - Win32 Release_TS"\r
+# Begin Group "Source Files"\r
+\r
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+# Begin Source File\r
+\r
+SOURCE=.\mysql.c\r
+# End Source File\r
+# End Group\r
+# Begin Group "Header Files"\r
+\r
+# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
+# Begin Source File\r
+\r
+SOURCE=.\php3_mysql.h\r
+# End Source File\r
+# End Group\r
+# Begin Group "Resource Files"\r
+\r
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
+# End Group\r
+# Begin Source File\r
+\r
+SOURCE=.\Readme_w32.txt\r
+# End Source File\r
+# End Target\r
+# End Project\r
index 2b5e55e9852715c0b6bbee7e360e331eaff453ea..fc964a19453a26090b49dcd996048633fcff49e2 100644 (file)
@@ -36,6 +36,9 @@
 #if COMPILE_DL
 #undef HAVE_MYSQL
 #define HAVE_MYSQL 1
+#      if WIN32||WINNT
+#      define PHP_MYSQL_API __declspec(dllexport)
+#      endif
 #endif
 
 #if HAVE_MYSQL
 #define DLEXPORT
 #endif
 
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
 extern php3_module_entry mysql_module_entry;
 #define mysql_module_ptr &mysql_module_entry
 
@@ -106,7 +113,7 @@ typedef struct {
 # define MySLS_CC
 # define MySG(v) (mysql_globals.v)
 # define MySLS_FETCH()
-extern ZEND_API php_mysql_globals mysql_globals;
+extern PHP_MYSQL_API php_mysql_globals mysql_globals;
 #endif
 
 
index c0652962392f26c80a09641cfbf85afddecdcca1..ba1827b10250eadebfc972ae07056e33fba65db8 100644 (file)
@@ -37,7 +37,6 @@
    ---------------------------------------------------------------*/
 #if !defined(COMPILE_DL)
 #define HAVE_SNMP 0
-#define HAVE_MYSQL 0
 # define HAVE_ERRMSG_H 0 /*needed for mysql 3.21.17 and up*/
 #define HAVE_LDAP 0
 #define DBASE 0
index 955cbe66ca9aa7efadf71762912c633073f846c2..8872f198a05f52960f8b1b3269bc3d0aefcdbb7b 100644 (file)
@@ -190,7 +190,7 @@ extern char *strerror(int);
 #endif
 
 #if HAVE_PWD_H
-# if MSVC5
+# if WIN32||WINNT
 #include "win32/pwd.h"
 #include "win32/param.h"
 # else
@@ -258,8 +258,6 @@ extern pval *data;
 extern char **environ;
 #endif
 
-extern PHPAPI int le_index_ptr;  /* list entry type for index pointers */
-
 extern void phperror(char *error);
 extern PHPAPI void php3_error(int type, const char *format,...);
 extern PHPAPI int php3_printf(const char *format,...);
index ea2597e6a6292281d11e725638243186ec7dbab0..7dd5cf40027e07efa8f012b47387090dfbde501b 100644 (file)
@@ -12,7 +12,7 @@ typedef struct _php_core_globals php_core_globals;
 # define PLS_CC , PLS_C
 # define PG(v) (core_globals->v)
 # define PLS_FETCH()   php_core_globals *core_globals = ts_resource(core_globals_id)
-PHPAPI extern int core_globals_id;
+extern PHPAPI int core_globals_id;
 #else
 # define PLS_D
 # define PLS_DC
index e5b219eea693d4aebe3468953c35f75ab8b2c3dd..610e85ce12d1c27ed165f542514be69bbfe2245d 100644 (file)
@@ -351,7 +351,7 @@ PHPAPI void display_ini_entries(zend_module_entry *module)
 
 /* Standard message handlers */
 
-PHP_INI_MH(OnUpdateInt)
+PHPAPI PHP_INI_MH(OnUpdateInt)
 {
        long *p;
 #ifndef ZTS
@@ -369,7 +369,7 @@ PHP_INI_MH(OnUpdateInt)
 }
 
 
-PHP_INI_MH(OnUpdateReal)
+PHPAPI PHP_INI_MH(OnUpdateReal)
 {
        double *p;
 #ifndef ZTS
@@ -387,7 +387,7 @@ PHP_INI_MH(OnUpdateReal)
 }
 
 
-PHP_INI_MH(OnUpdateString)
+PHPAPI PHP_INI_MH(OnUpdateString)
 {
        char **p;
 #ifndef ZTS
@@ -405,7 +405,7 @@ PHP_INI_MH(OnUpdateString)
 }
 
 
-PHP_INI_MH(OnUpdateStringUnempty)
+PHPAPI PHP_INI_MH(OnUpdateStringUnempty)
 {
        char **p;
 #ifndef ZTS
index 09a9f62c1bbd6b86cb437a00fa25af06b9dbb4a4..dc57089588af766c23ca3f7f904b65373716d627 100644 (file)
@@ -111,10 +111,10 @@ pval *cfg_get_entry(char *name, uint name_length);
 
 
 /* Standard message handlers */
-PHP_INI_MH(OnUpdateInt);
-PHP_INI_MH(OnUpdateReal);
-PHP_INI_MH(OnUpdateString);
-PHP_INI_MH(OnUpdateStringUnempty);
+PHPAPI PHP_INI_MH(OnUpdateInt);
+PHPAPI PHP_INI_MH(OnUpdateReal);
+PHPAPI PHP_INI_MH(OnUpdateString);
+PHPAPI PHP_INI_MH(OnUpdateStringUnempty);
 
 
 #define PHP_INI_DISPLAY_ORIG   1
diff --git a/php4ext.dsw b/php4ext.dsw
new file mode 100644 (file)
index 0000000..8cf96a8
--- /dev/null
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00\r
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\r
+\r
+###############################################################################\r
+\r
+Project: "mysql"=.\ext\mysql\mysql.dsp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Global:\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<3>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r