Re: Overriding Default Functions
| From: | Wez Furlong | Date: | Wed, 16 Nov 2005 00:07:44 +0000 |
| Subject: | Re: Overriding Default Functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-20038@lists.php.net to get a copy of this message | ||
I think runkit is what you're looking for.
http://pecl.php.net/packages/runkit
--Wez.
On 11/15/05, Alan Cox <acox@broadwick.com> wrote:
> Hello -
> Is there a way to build an extension that overrides the default
> behavior of a built-in PHP function? Would it be possible to add an
> extension that removes a PHP function, so that I could redefine it in my
> PHP code?
>
> What I want to do is override the time calculations. We are running
> unit tests on a testing server that are dependent on time. For
> instance, there is one behavior before the 15th of the month and another
> one on or after the 15th. I'm not able to change the system time, since
> this testing server is used by a lot of people. What I'd like to be
> able to do is load a module in the unit test that makes it so that a
> custom time() function is used. This time() function wouldn't look at
> the system clock for the time.
>
> Thanks for your help.
> Alan
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>