krakjoe / uopz

User Operations for Zend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow calling the original function on a uopz_set_return closure

ecommpro opened this issue · comments

I think one of the most interesting features of old version for PHP5 was the ability for rename a built-in function and, this way, create a wrapper in which we can call the original renamed function if necessary.

The only way I figure to achieve this on this version without modifying the functions table is having a reference to the original function in the closure passed to uopz_set_return when the flag execute is true.

Is there any way to achieve this?

For some reason, a call to the original function from the body of closure is not re-intercepted. That's exactly I was looking for.

If that's true and general, I think it would be great to add to the documentation in README.md file.

I'm closing the issue. Thanks, and great work.

That's already implicitely documented via an example. I've added a brief note to the function description now.