Hi,
I wanted first to know if php source code can welcome oses specific
features or should it remain as separated php modules ?
For instance awhile ago I implemented a wrapper around OpenBSD's pledge for
suhosin (php 5.x series) here
https://github.com/sektioneins/suhosin/blob/master/pledge.c
Thanks.
Kindest regards.
I wanted first to know if php source code can welcome oses specific
features or should it remain as separated php modules ?
Hi David,
I think there is not really a distinction between "PHP source code" and
"separated modules", since pretty much everything above the syntax level
is technically an "extension". As illustration, note that the really
basic functions like string and array manipulation are in the directory
"ext/standard"; obviously, you can't turn that module off, but it is
just one of 72 that are distributed with official builds.
The main difference is between "bundled" extensions and those on PECL
(http://pecl.php.net). If what you're looking at would make sense as a
group of functions / classes in its own right, it might be wise to work
on it first as an independent extension on PECL. This gives you the
freedom to present a proof of concept, release early and often, and make
breaking changes based on experience with early adopters. Once it's
mature, you can ask for it to be adopted into core, where you could
remain as maintainer, but be constrained by the release process and
compatibility promises of the main project.
If it's a more natural fit for an existing extension, though, or more of
a low-level implementation issue, I'd suggest going ahead and proposing
it, and being open to suggestions of how best to proceed for that
particular case.
As for platform-specific features, there certainly are functions, and
entire bundled extensions, that are platform-specific. Quickly glancing
for obvious examples, I can see that ext/com_dotnet is Windows-only,
while ext/posix is unavailable on Windows. Where possible, functionality
is emulated such that it is available on as many platforms as possible,
even if this means degraded functionality (uniqid() is an example that
springs to mind), but sometimes you just want access to a feature that's
unique to one platform.
Regards,
--
Rowan Collins
[IMSoP]
Hi!
I wanted first to know if php source code can welcome oses specific
features or should it remain as separated php modules ?
If it's an extension, there's nothing wrong with OS-specific ones -
though it would be in a good taste to clearly mark it as such in the
documentation.
The code that we have in the core (i.e. distributed from php.net) we try
to keep as portable as possible within reasonable set of systems, though
some functions may still not work on some OSes because they don't have
that feature. But generally OS-specific bits are usually best as an
extension.
Stas Malyshev
smalyshev@gmail.com