Forbid serializing a Crawler
Unserializing a Crawler instance creates DOM elements in an invalid state, making the Crawler unusable.
This commit is contained in:
parent
7a142fd17b
commit
12733cba00
@ -311,6 +311,17 @@ class Crawler extends \SplObjectStorage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Serializing and unserializing a crawler creates DOM objects in a corrupted state. DOM elements are not properly serializable.
|
||||||
|
public function unserialize($serialized)
|
||||||
|
{
|
||||||
|
throw new \BadMethodCallException('A Crawler cannot be serialized.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function serialize()
|
||||||
|
{
|
||||||
|
throw new \BadMethodCallException('A Crawler cannot be serialized.');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a node given its position in the node list.
|
* Returns a node given its position in the node list.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user