Re: Class Destruction / Reloading
| From: | Sara Golemon | Date: | Fri, 20 Aug 2004 20:27:20 +0000 |
| Subject: | Re: Class Destruction / Reloading | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-12282@lists.php.net to get a copy of this message | ||
> 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.
>
I took this in a slightly different direction:
http://pecl.php.net/classkit Any and all thoughts
appreciated.
Function Entries:
bool classkit_method_add(string classname, string methodname, string
args, string code[, long flags])
bool classkit_method_redefine(string classname, string methodname,
string args, string code[, long flags])
Note: flags parameter requires PHP >= 5.0.0
bool classkit_method_remove(string classname, string methodname)
bool classkit_method_rename(string classname, string methodname, string
newname)
Constants (passed in flags parameter):
CLASSKIT_ACC_PUBLIC
CLASSKIT_ACC_PROTECTED
CLASSKIT_ACC_PRIVATE
-Sara