Download the PHP package hollodotme/inclomplete-class-accessor without Composer
On this page you can find all versions of the php package hollodotme/inclomplete-class-accessor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download hollodotme/inclomplete-class-accessor
More information about hollodotme/inclomplete-class-accessor
Files in hollodotme/inclomplete-class-accessor
Download hollodotme/inclomplete-class-accessor
More information about hollodotme/inclomplete-class-accessor
Files in hollodotme/inclomplete-class-accessor
Vendor hollodotme
Package inclomplete-class-accessor
Short Description Class to access ALL properties of a __PHP_Incomplete_Class
License MIT
Package inclomplete-class-accessor
Short Description Class to access ALL properties of a __PHP_Incomplete_Class
License MIT
Please rate this library. Is it a good library?
Informations about the package inclomplete-class-accessor
IncompleteClassAccessor
Class to access ALL properties of a __PHP_Incomplete_Class
PLEASE NOTE: This is a proof of concept and not ment to be used in production software.
Use case
- You have an object serialized and stored to e.g. the database.
- Time is passing by and the underlying class has been modified, moved or deleted.
- You read the serealized object from your storage and receive a
__PHP_Incomplete_Class
object. - You want to read the object's properties, even those which are private.
PHP build-in
- PHP does not provide a convenient way to read private properties from such an object.
ReflectionClass
does not publish any of the properties. - The available
unserialize_callback_func
only lets you load an apropriate class by name (which may not exist anymore).
What IncompleteClassAccessor does
- Reads the name of the original class from the
__PHP_Incomplete_Class
object. - It serializes the
__PHP_Incomplete_Class
object. - It modifies the resulting serialized string to convert the
__PHP_Incomplete_Class
object to astdClass
object. - It unserializes the modified string and reads all (now accessable) object properties into a key-value array.
- If a property value itself is a
__PHP_Incomplete_Class
object, it creates an instance ofIncompleteClassAccessor
for this value. (So it is recursive.)
Example usage
You are now able to map the old serialized object to an apropriate new one.
All versions of inclomplete-class-accessor with dependencies
PHP Build Version
Package Version
Requires
php-64bit Version
>=5.5
The package hollodotme/inclomplete-class-accessor contains the following files
Loading the files please wait ....