Skip to content
Browse files

On win32 extensions starts with php_

  • Loading branch information...
1 parent aefb8fe commit c26303c7895473c54d926b03cb6437073c26cd6f @fmk fmk committed Oct 29, 2003
Showing with 15 additions and 2 deletions.
  1. +13 −0 ext/ext_skel_win32.php
  2. +2 −2 ext/skeleton/skeleton.dsp
View
13 ext/ext_skel_win32.php
@@ -49,4 +49,17 @@
}
}
+$fp = fopen("$extname/$extname.php", "rb");
@solio
solio added a note Sep 25, 2013

Is anyone think here the code snippet(52 to 63) exists some bugs.
Resume code : $fp = fopen("$extname/$extname.php", "rb");
The file uri "$extname/$extname.php" is not existed when you build a extension.
Right here, you read the content from an empty file,and then you put nothing into the new file "$extname/$extname.php".
In my opinions,it should be like following:
$fp = fopen("$skel/skeleton.php", "rb");
if ($fp) {
$php_file = fread($fp, filesize("$skel/skeleton.php"));
fclose($fp);

$php_file = str_replace("dl('", "dl('php_", $php_file);
$php_file = str_replace("extname", $extname, $php_file);
$fp = fopen("$extname/$extname.php", "wb");
if ($fp) {
    fwrite($fp, $php_file);
    fclose($fp);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+if ($fp) {
+ $php_file = fread($fp, filesize("$extname/$extname.php"));
+ fclose($fp);
+
+ $php_file = str_replace("dl('", "dl('php_", $php_file);
+ $fp = fopen("$extname/$extname.php", "wb");
+ if ($fp) {
+ fwrite($fp, $php_file);
+ fclose($fp);
+ }
+}
+
?>
View
4 ext/skeleton/skeleton.dsp
@@ -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 php4ts.lib /nologo /dll /machine:I386
-# 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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
+# 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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_extname.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
!ELSEIF "$(CFG)" == "extname - Win32 Debug_TS"
@@ -81,7 +81,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 php4ts.lib /nologo /dll /machine:I386
-# 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 php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/extname.dll" /libpath:"..\..\Debug_TS"
+# 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 php4ts_debug.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/php_extname.dll" /libpath:"..\..\Debug_TS"
!ENDIF

0 comments on commit c26303c

Please sign in to comment.
Something went wrong with that request. Please try again.