Feature(let) idea

php.internals

Andi Gutmans

19 years ago
I got a feature idea from Apache. Apache will automatically translate mod_rewrite.so in LoadModule to mod_rewrite.dll on Windows. It'd be nice if we added the same to PHP so you wouldn't need to maintain two php.ini's between UNIX & Windows machines. It's a pretty easy patch but I wanted to run it by people here before working on a patch. Andi

Stefan Priebsch

19 years ago
Andi, Andi Gutmans schrieb:
> I got a feature idea from Apache. Apache will automatically translate > mod_rewrite.so in LoadModule to mod_rewrite.dll on Windows. It'd be nice > if we added the same to PHP so you wouldn't need to maintain two > php.ini's between UNIX & Windows machines. It's a pretty easy patch but > I wanted to run it by people here before working on a patch. > > Andi
I like this idea, but the directory layout is usually rather different between Windows and Unix, so there will probably still be differences in the php.ini regarding to include_path and extension_dir. Kind regards, Stefan
-- >e-novative> - We make IT work for you. e-novative GmbH - HR: Amtsgericht München HRB 139407 Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch http://www.e-novative.de

David Zülke

19 years ago
Yeah, not to mention things like temp dirs, sendmail/smtp settings etc... David Am 19.06.2007 um 08:51 schrieb Stefan Priebsch:

Lukas Kahwe Smith

19 years ago
David Zülke wrote:
> Yeah, not to mention things like temp dirs, sendmail/smtp settings etc...
meaning to make it really useful, we would need a general way to handle such platform difference. maybe with a syntax to handle platform specific settings or prefixing of directories, but I guess then we are beyond what ini files are designed for. that being said, maybe simply minimizing the differences is already a worthy cause? regards, Lukas

Pierre Joye

19 years ago
On 6/19/07, Stefan Priebsch <stefan.priebsch@e-novative.de> wrote:
> Andi, > > Andi Gutmans schrieb: > > I got a feature idea from Apache. Apache will automatically translate > > mod_rewrite.so in LoadModule to mod_rewrite.dll on Windows. It'd be nice > > if we added the same to PHP so you wouldn't need to maintain two > > php.ini's between UNIX & Windows machines. It's a pretty easy patch but > > I wanted to run it by people here before working on a patch. > > > > Andi > > I like this idea, but the directory layout is usually rather different > between Windows and Unix, so there will probably still be differences in > the php.ini regarding to include_path and extension_dir.
The idea is to use the same set of "extension=foo" directives for all platforms (nearly all). It is relatively obvious that extension_dir will differ. I like this idea and will ease our life, a litte :) Cheers, --Pierre

Stefan Priebsch

19 years ago
Pierre,
> The idea is to use the same set of "extension=foo" directives for all > platforms (nearly all). It is relatively obvious that extension_dir > will differ. > > I like this idea and will ease our life, a litte :)
I got that, and I like simplification. It would just not really make php.ini files "portable" between Windows and Unix. I could even think of some other feature(let)s that might help us move into that direction: - define a unified path separator for include_path (the system-dependend ones could still be accepted, thus keeping BC) - accept paths in php.ini with forward slashes on all systems (I think Apache also does -even requires- it that way) - for system-dependent settings like SMTP, have SMTP.Windows and SMTP.Unix settings that can "override" the general SMTP setting (this idea certainly needs some more thought) - also make zend_extension and zend_extension_ts "guess" wether dll or so is to be loaded Kind regards, Stefan
-- >e-novative> - We make IT work for you. e-novative GmbH - HR: Amtsgericht München HRB 139407 Sitz: Wolfratshausen - GF: Dipl. Inform. Stefan Priebsch http://www.e-novative.de

Pierre Joye

19 years ago
On 6/19/07, Stefan Priebsch <stefan.priebsch@e-novative.de> wrote:
> Pierre, > > > The idea is to use the same set of "extension=foo" directives for all > > platforms (nearly all). It is relatively obvious that extension_dir > > will differ. > > > > I like this idea and will ease our life, a litte :) > > I got that, and I like simplification. It would just not really make > php.ini files "portable" between Windows and Unix.
It will make extension mgr life easier, not more, not less, and that's already a lot :)
> I could even think of some other feature(let)s that might help us move > into that direction: > > - define a unified path separator for include_path (the system-dependend > ones could still be accepted, thus keeping BC) > - accept paths in php.ini with forward slashes on all systems (I think > Apache also does -even requires- it that way)
We support / on windows already. If someone uses \ only, he puts himself in the non ""portable"" side. I don't really see a reason to stop to support one or another.
> - also make zend_extension and zend_extension_ts "guess" wether dll or > so is to be loaded
just like the extension directive yes. That being said, a 100% portable php.ini is not possible, the main problem I had so far was to deal with different extension names on the various platforms. However, it was less than a problem after that dl() has been deprecated. But it can make installer/tester life easier to have one common way to define extension in php.ini, even if the various paths differ (to stay on topic). Grüß --Pierre

LAUPRETRE François (P)

19 years ago
> The idea is to use the same set of "extension=foo" directives for all > platforms (nearly all). It is relatively obvious that extension_dir > will differ.
IMHO, it should also allow to dl() by extension name, but only as a fallback mechanism to keep BC. First consider the argument as a filename, then, if it cannot be loaded, try to add the prefix/suffix corresponding to the current architecture. Performance aspects shouldn't matter for dl(). Here is an example of the logic to implement, taken from the PHK code (I think it is the same in PEAR now, with the HP-UX case added recently) : public static function require_extension($ext) { if (extension_loaded($ext)) return; if (ini_get('enable_dl') != 1) trigger_error($ext.': Cannot load extension when enable_dl is Off' ,E_USER_ERROR); if (ini_get('safe_mode') == 1) trigger_error($ext.': Cannot load extension in safe mode',E_USER_ERROR); if (substr(PHP_OS, 0, 3) == 'WIN') $suffix = '.dll'; elseif (PHP_OS == 'HP-UX') $suffix = '.sl'; elseif (PHP_OS == 'AIX') $suffix = '.a'; elseif (PHP_OS == 'OSX') $suffix = '.bundle'; else $suffix = '.so'; @dl('php_'.$ext.$suffix) || @dl($ext.$suffix); if (!extension_loaded($ext)) throw new Exception("$ext: Cannot load extension"); }

William A. Rowe, Jr.

19 years ago
Andi Gutmans wrote:
> I got a feature idea from Apache. Apache will automatically translate > mod_rewrite.so in LoadModule to mod_rewrite.dll on Windows.
It does? Apache/Win32 actually names the '.dll' as mod_rewrite.so on windows. There's nothing special about the '.dll' filename extension, a similar example is the .cpl control panel extensions, which are .dll's that are loaded into the system settings schema, .scr for screensaver dll's following that API, etc. In general, it's a good idea. My builds of php on win32 *are* entirely in the unix-style, for my customers who need to toggle between win32 and unix. It makes the documentation much simpler when you don't need two entirely different sets. Bill

Andi Gutmans

19 years ago
Damn, I think you are right :) That's weird. There are some tools which only work with the .dll filename (i.e. Windows Explorer). Maybe my idea is better then :) Andi

William A. Rowe, Jr.

19 years ago
Windows Explorer on WinXP does a fine job for me displaying binary version numbers, pulling up dll properties of .so files, etc. Not sure which issue you are seeing? Andi Gutmans wrote:

Richard Quadling

19 years ago
On 21/06/07, William A. Rowe, Jr. <wrowe@rowe-clan.net> wrote:
> Windows Explorer on WinXP does a fine job for me displaying binary > version numbers, pulling up dll properties of .so files, etc. > > Not sure which issue you are seeing? > > > > Andi Gutmans wrote: > > Damn, I think you are right :) > > That's weird. There are some tools which only work with the .dll > > filename (i.e. Windows Explorer). > > > > Maybe my idea is better then :) > > Andi > > > >> -----Original Message----- > >> From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net] > >> Sent: Wednesday, June 20, 2007 10:53 PM > >> To: Andi Gutmans > >> Cc: internals@lists.php.net > >> Subject: Re: [PHP-DEV] Feature(let) idea > >> > >> Andi Gutmans wrote: > >>> I got a feature idea from Apache. Apache will automatically > >> translate > >>> mod_rewrite.so in LoadModule to mod_rewrite.dll on Windows. > >> It does? Apache/Win32 actually names the '.dll' as > >> mod_rewrite.so on windows. There's nothing special about the > >> '.dll' filename extension, a similar example is the .cpl > >> control panel extensions, which are .dll's that are loaded > >> into the system settings schema, .scr for screensaver dll's > >> following that API, etc. > >> > >> In general, it's a good idea. My builds of php on win32 > >> *are* entirely in the unix-style, for my customers who need > >> to toggle between win32 and unix. It makes the documentation > >> much simpler when you don't need two entirely different sets. > >> > >> Bill
In the main, I think it would be very odd for Windows users to see .so files in place of .dlls. For those not aware, in windows the extension is linked to a handler (Run, Open, Edit, Print, etc) via the registry. A .dll file is known to be an "Application Extension" and has no default Run/Open handler, though you can install something like a resource explorer to examine the dll as they often contain menus, bitmaps, icons, dialogs, etc (resources). So, making the files .so for compatibility to other OS's, as far as windows goes, is fine. But, confusing for many probably.
-- ----- Richard Quadling Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 "Standing on the shoulders of some very clever giants!"