Recommend this page to a friend! |
Download .zip |
Info | View files (4) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2006-05-06 (10 years ago) | 59% | Total: 580 | All time: 5,064 This week: 935 |
Version | License | Categories | ||||
object-ext 1.0 | MIT/X Consortium ... | PHP 5, Language |
Description | Author | |||||||||||||
This class can be used to extend already instantiated objects with new functions and variables. |
|
Object Extensions for PHP A runtime object extension and callback library for PHP The Object Extensions library for PHP adds the following functionality to objects that extend the base class: - Runtime object extension to "extend" an object by another class at runtime (to virtually inherit all public properties and methods). - Runtime callback definitions to be able to pass function/method callbacks as variables, and subsequently execute them from other function/methods. - Dynamic object properties class to handle runtime setting/getting of object properties, as well as ability to pass function arguments as object-based parameters rather than long list of options. OBJECT EXTENSION: - Base class (CExtendable) implements a _extend() function by which you may vritually extend an object by an instance of another object. - Extended object (object passed to _extend) can reference parent object if supported by extended class. - __get, __set and __call are all overriden to handle overriding undefined properties and methods - Ability to reference a callback in a straightforward manner ($object->_callback()->method(args, [...])) CALLBACK FUNCTIONALITY: - Can create callbacks directly (through CCallback and derived classes) - Can create method callbacks by calling _callback() method on CExtendable objects - When combined with object extension and object properties, can provide a really easy way to execute callbacks. OBJECT PROPERTIES: - Base class extends ArrayIterator, all properties saved in an array - Basic functionality to check values provided and/or set default values. - Overrides __get, __set to get/set object properties. - Can limit property set-tability to existing properties only, or to provided array of properties. - Can enable read-only mode. - Overrides __call, and in the case that the a property value with the same name as the method name exists, and is an instance of the ICallback interface, this callback is executed. PHP COMPATIBILITY: Object Extensions for PHP uses PHP5 functionality. It would be theoretically possible to implement similar functionality into PHP4, however, since I no longer develop in PHP4, I cannot properly test it. |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
User Ratings | ||||||||||||||||||||||||||||||
|
Applications that use this package |
Sevenlight CMS Commercial CMS that relies heavily on runtime extensions and method callbacks |
If you know an application of this package, send a message to the author to add a link here.