-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runkit_method_* doesn't work for internal classes like PDO #60
Comments
Do you have a short reproduce code? |
Sure, the code if (!runkit_method_rename('PDO', 'query', '__query')) {
throw new RuntimeException('Failed to rename PDO::query to PDO::__query');
} produces an exception and a warning
|
For example, this is being checked here https://github.com/zenovich/runkit/blob/master/runkit_methods.c#L132. Is it possible to remove this condition and allow to modify any classes? |
ptrofimov : did you try to remove the condition ? Did it work ? I just tried to remove the three conditions on internal method and internal function into this file : and it worked. But it's dangerous ! For now :
The commit that does that : |
Would be great if this could be toggle without patching the source.
returns a custom class instead which can then include logging or other logic. |
I'm not sure if it helps anyone, but I'm running into a similar problem that I think this would resolve. We're trying to test Time based functionality, and while runkit can override functions like // First, override time() using runkit
$now = new \DateTime();
$now->setTimestamp(time()); This ensures the If there was an easy way to override |
For the record: that had already been reported as https://bugs.php.net/bug.php?id=57330. |
Even if flag runkit.internal_override=1. Is it possible to enable it?
The text was updated successfully, but these errors were encountered: