Re: [PHP-DEV] Overwriting (internal) functions From: Zeev Suraski (zeev <email protected>)
Date: 08/28/00

We discussed this ability in the past. Even though it may be fairly easy
to implement it (even though as usual, it's tougher than it looks) - it was
generally accepted that this was not a good idea. If people expect a
certain function to perform something, letting users overwrite it with new
functionality (e.g., inside libraries) is going to cause lots of confusion.

Zeev

At 16:42 28-08-00, Wico de Leeuw wrote:
>Hiya
>
>Anyone who can thing of more thing you can do with overwriting (internal)
>functions?
>(To convince Andrei the use of such a thing)
>
>Please let me know
>
>Greetz,
>
>Wico
>
>At 08:41 28-8-2000 -0500, you wrote:
>>Yes, I got it. I still wouldn't see myself personally using it, for
>>example, so you'd probably need to post this to the list..
>>
>>On Mon, 28 Aug 2000, Wico de Leeuw wrote:
>> > Hiya
>> >
>> > Did you get this mail?
>> >
>> > and did (does) it include enough arguments?
>> >
>> > Greetz,
>> >
>> > Wico
>> >
>> > At 16:35 25-8-2000 +0200, Wico de Leeuw wrote:
>> > >At 09:11 25-8-00 -0500, you wrote:
>> > >>On Fri, 25 Aug 2000, Wico de Leeuw wrote:
>> > >> > hmmm You got a point there, but whould be nice though
>> > >>
>> > >>I don't really see what it would be nice for. Perhaps, you can write
>> > >>down several situations.
>> > >
>> > >1 : register_shutdown_function won't allow output
>> > >if i can overwite die and exit (return?) i have a custom
>> > >register_shutdown_function with output
>> > >
>> > >2: header
>> > >Ob fuctions still can't get the current headers (and change them)
>> > >(requested as feature)
>> > >if i can replace header i can parse the headers (add sid for example)
>> > >before i output them
>> > >
>> > >3: debugging
>> > >you can easly build debuging function without putting echo or a function
>> > >call b4 everting you want to debug (think of sockets) you can replace a
>> > >fput with a custom that outputs it to screen and to the socket
>> > >
>> > >4: Make easy layers for things
>> > >situation:
>> > >you just changed you msql server to mysql (suppose you can't do a
>> > >search/replace) and you don't want to rewrite all your programms
>> > >you overwrite mssql_* to mysql_* problem (almost) fixed
>> > >
>> > >5: fill in here
>> > >i guess the are a lot more options users can think of ask them and be
>> > >supprised
>> > >
>> > >Still not convinced about the usefullness ask and i write a dozen other
>> > >reasons
>> > >
>> > >P.S. Sorry fot the many typefaults :)
>> > >
>> > >Greetz,
>> > >
>> > >Wico
>> > >
>> > >
>> > >
>> > >> > Maybe a special Function you gotta call first on a page to allow
>> the page
>> > >> > to use overwritten function(s) And a option in php.ini to allow
>> it on all
>> > >> > pages (default off ofcourse)
>> > >> >
>> > >> > And with compiled liberies you keep the problem that you don't know
>> > >> what it
>> > >> > will do
>> > >> > I can register an shutdown function (or even when you include it
>> can do
>> > >> > things)wich collects some stuff and still emails it to the author
>> > >> (user and
>> > >> > password for the current dir if not empty)
>> > >> > you will never notice it
>> > >>
>> > >>
>> > >>
>> > >>-Andrei
>> > >>* The best source is the source code. *
>> > >
>> > >
>> > >--
>> > >PHP Development Mailing List <http://www.php.net/>
>> > >To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>> > >For additional commands, e-mail: php-dev-help <email protected>
>> > >To contact the list administrators, e-mail: php-list-admin <email protected>
>> > >
>> >
>>
>>
>>
>>-Andrei
>>* Think digital, act analog. *
>
>
>--
>PHP Development Mailing List <http://www.php.net/>
>To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
>For additional commands, e-mail: php-dev-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>

--
Zeev Suraski   <zeev <email protected>>
http://www.zend.com/

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>