We have serialized classes stored in our database that we are trying to deserialize with new psr 4 class names. When we run the deserialize function the class is not created properly.
The old and new classes are the same the only thing that has really changed is that the names are different from psr 0 class names to psr 4 classes. When we deserialize we are making sure to use class_alias to point the old classes stored in the serialized code to the new classes. We are not getting any errors when we deserialize but the class properties are not setup properly.
For example we are working with the serialized class Company_Shipping
. We alias that class before to Company\Shipping
, but when we dump the object we get the properties
private '_method' => null
private '_method' (Company_Shipping) => string 'ground' (length=6)
We should be just getting
private '_method' => string 'ground' (length=6)
So one, is there a way to access the second private property with the old class name in brackets? If I could do that I might be able to transfer the properties in the __wake
method, but I can't figure out how to access them. However, if someone knows how to fix this deserialization that would be great too.