Re: A Windows extension

From: Date: Fri, 07 Nov 2003 13:23:36 +0000
Subject: Re: A Windows extension
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-189@lists.php.net to get a copy of this message
For the licencing PHP licence souds well for me. The res protocol is not yet implemented as a stream, of course it's the better idea and i'll probably add it. It is implemented as functions calls for now. But i got a working PHP level stream class for it (not helpful for PECL i agree ;).
I don't think it is wise to wrap every win32 API known to man; using something like ffi for those is probably better, unless there is significant demand for having a PHP native version.
I totaly agree with that but i have to explain my point of view: The goal is not to wrap simple function that can be acced by ffi but to hide the Microsoft specific complexity in some subject when i said "Any Win32 API function that users needs" i would better say: Any Win32 API subject that user need (ex: res protocol or registry access) For exemple the process to have a simple working "File Open" dialog box using the Win32 API (not MFC) is a half an hour work i let you imagine what it can take using ffi. And i want it to be usefull too for people that don't have access to the MSDN library (it's not cheap ;). Experienced programmer that need a rarely used Win32 API function can use ffi but all PHP programmer that know how to add a extension=php_win32std.dll can use the browse_file function to prompt the user for a file to open.
- PHP thread support (already working - but need improvements)
I think that this is a losing battle (PHP just isn't designed to work that way). However, it would be cool if you can get something working. It would be better to have that effort put into the existing PECL threads package rather than a win32 extension
I got something working ! Of course it is not designed to work with a Web server, it's only usefull for client scripting (ie: accepting user input while working in backgroud) For now it work with a call to a script file, it will be better if it can take a copy of a PHP user level function and i think it could be possible by using a process similar to those that are used in caches extension. The second problem for now is that the result is all returned after the end of the job, i think i had to implement a shared memory access (could it be done with existing extension ??) or something else. And i think it's a good idea to add it to an existing PECL package, but i'm an ugly Windows programmer and the best i can do is to port an existing extension to Windows. To end i realy think that PHP can beat VB on Windows platform (ho my god i've said it ;) due to it's powerful and simple nature, and my goal is to give the opportunity to do that for all. I currently working on an other extension that give RAD visual possibilities to PHP client scripting under Windows, i'll ask PECL next week for comments. Eric At 12:39 07/11/2003, Wez Furlong wrote:
I'm about to end an extension that implement several standard Win32 API function that is useful when using PHP as a Windows scripting engine. Sounds interesting :-) This can be added to PECL, provided you use a compatible license (check the archives for more on this!). I would suggest using the PHP license. This extension feature: - res protocol read/write Using streams? - PHP thread support (already working - but need improvements) I think that this is a losing battle (PHP just isn't designed to work that way). However, it would be cool if you can get something working. It would be better to have that effort put into the existing PECL threads package rather than a win32 extension. - Any Win32 API function that users needs I have written an ffi extension that will replace the current unmaintained and broken w32api (and also work on many other platforms). You can then load any win32 api at runtime without the need for (re)compiling and worrying about the versioning of your win32std extension. I don't think it is wise to wrap every win32 API known to man; using something like ffi for those is probably better, unless there is significant demand for having a PHP native version. --Wez. -- PECL development discussion Mailing List (http://pecl.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pecl.dev (#189) next »