mail() into separate extension?

php.internals

Piotr Roszatycki

21 years ago
Hi. I'd like to see mail() function in separate extension module. It would be possible to replace i.e. standard `extension=mail.so' with i.e. `extension=sendmail.so'. What do you think? Is it worth to prepare the patch?
-- .''`. Piotr Roszatycki, Netia SA : :' : mailto:Piotr_Roszatycki@netia.net.pl `. `' mailto:dexter@debian.org `-

George Schlossnagle

21 years ago
Drop-in replacements are evil. If you want to do this, you should just create a new function that does what you need to do and name it differently. If you're dead-set on doing a name-based replacement, then you should have your extension modify the symbol table directly, but again, this is evil. George On Jul 18, 2005, at 9:57 AM, Piotr Roszatycki wrote:
> Hi. I'd like to see mail() function in separate extension module. > It would be > possible to replace i.e. standard `extension=mail.so' with i.e. > `extension=sendmail.so'. > > What do you think? Is it worth to prepare the patch? > -- > .''`. Piotr Roszatycki, Netia SA > : :' : mailto:Piotr_Roszatycki@netia.net.pl > `. `' mailto:dexter@debian.org > `- > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
George Schlossnagle -- Vice President of Engineering -- OmniTI Computer Consulting -- http://www.omniti.com

Andrew Yochum

21 years ago
On Jul 18, 2005, at 10:15 AM, George Schlossnagle wrote:
> Drop-in replacements are evil. If you want to do this, you should > just create a new function that does what you need to do and name > it differently. If you're dead-set on doing a name-based > replacement, then you should have your extension modify the symbol > table directly, but again, this is evil. > > George
George, Can you please substantiate your statement that drop-in replacements are evil? I could only see them being a problem if they don't fully implement the existing API. Andrew
-- Andrew Yochum Plexpod andrew@plexpod.com

George Schlossnagle

21 years ago
On Jul 18, 2005, at 10:30 AM, Andrew Yochum wrote:
> On Jul 18, 2005, at 10:15 AM, George Schlossnagle wrote: > > >> Drop-in replacements are evil. If you want to do this, you should >> just create a new function that does what you need to do and name >> it differently. If you're dead-set on doing a name-based >> replacement, then you should have your extension modify the symbol >> table directly, but again, this is evil. >> >> George >> > > George, > > Can you please substantiate your statement that drop-in > replacements are evil? > > I could only see them being a problem if they don't fully implement > the existing API.
Sure. They inevitably will have differing behaviors (if not, why not just have a single unified function). Given that, you'll have different behaviors on different machines in a way that is not terribly transparent to end-users. That's evil. Not that there's anything wrong with being evil from time to time. That's the reason that apd had a replace_function call for mucking with the symbol table. But that's something that should be done locally. George

Piotr Roszatycki

21 years ago
On Monday 18 of July 2005 16:35, George Schlossnagle wrote:
> Sure. They inevitably will have differing behaviors (if not, why not > just have a single unified function). Given that, you'll have > different behaviors on different machines in a way that is not > terribly transparent to end-users. That's evil.
In fact the replacement for mail() function have to be transparent for end-users. They won't replace manually calls for mail() function with i.e. mail_smtp() function. That is the reason I would like to replace original function.
-- .''`. Piotr Roszatycki, Netia SA : :' : mailto:Piotr_Roszatycki@netia.net.pl `. `' mailto:dexter@debian.org `-