-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The platform should be cached, so the platform has not to be built each request.
I would do it with serialize(), but there's one problem: serialize() can't handle PHP built-in objects like SimpleXMLElement etc.
To work around this, __sleep() and __wakeup() must be implemented in each class, that has PHP built-in objects as properties.
Example:
/*
* @var SimpleXMLElement
*/
$element
public function __construct() {
$this->element = simplexml_load_string('<a b="c"><d e="f" /></a>');
}
public function __sleep() {
$this->element = $this->element->asXml();
}
public function __wakeup() {
$this->element = simplexml_load_string($this->element);
}
Metadata
Metadata
Assignees
Labels
No labels