Re: Class Destruction / Reloading
| From: | Zeev Suraski | Date: | Thu, 19 Aug 2004 07:53:46 +0000 |
| Subject: | Re: Class Destruction / Reloading | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12257@lists.php.net to get a copy of this message | ||
At 08:32 19/08/2004, Sara Golemon wrote:
Well, some time ago I wrote a small functions, that does exactly the same: PHP_FUNCTION(unregister_class) { *snip* Barring some stylectic differences and a check to make sure it's not an internal class, that's precisely what I gave sean in shiva_destroy_class().... But just to be clear, I don't think it's a good idea, and I'll wager dollars to doughnuts that it destablizes the active request if not the entire engine.From the technical perspective, it's actually easy to implement in a rock-solid manner. Don't kill the class completely but just clean any functions/properties inside of it, and mark it as dead. Then patch the class declaration begin code to check for this flag, and reuse the class structure instead of complaining about reregistering a class. There might be some more cleanup necessary in PHP 5, but if any, it shouldn't be too complicated. But I agree with you that it's a bad idea :) Zeev