We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code:
from phpserialize import serialize,unserialize from phpserialize.decorators import namespace @namespace('Faker') class Generator: protected_formatters = {'dispatch': 'system'} @namespace('Illuminate\Broadcasting') class PendingBroadcast: protected_event = 'ls' protected_events = Generator() a = serialize(PendingBroadcast()) print(a) s = unserialize(a) print(s)
Result:
This also happens when third-party classes extend PHP_Class.
Possible causes: Code here
In unserialize.py#_handle_object(), the for loop doesn't take cls.__namespace__ into consideration, while serialize.py#_handle_attr() does.
The text was updated successfully, but these errors were encountered:
进 unserialize 的对象需要继承 PHP_Class类:
unserialize
PHP_Class
from phpserialize import serialize, unserialize, PHP_Class class PendingBroadcast(PHP_Class): protected_event = 'ls' protected_events = Generator() a = serialize(PendingBroadcast()) print(a) s = unserialize(a) print(s)
一来是为了防止递归遍历object子类产生side effect,二来是让编写者“知道自己在干嘛”
关于namespace, known, will fix.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Code:
Result:

This also happens when third-party classes extend PHP_Class.
Possible causes:

Code here
In unserialize.py#_handle_object(), the for loop doesn't take cls.__namespace__ into consideration, while serialize.py#_handle_attr() does.
The text was updated successfully, but these errors were encountered: