When serializing a Route, don't serialize the compiled route.
This commit is contained in:
parent
5f6a17b8cc
commit
a6d44bdaa7
@ -18,7 +18,7 @@ namespace Symfony\Component\Routing;
|
|||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
class Route
|
class Route implements \Serializable
|
||||||
{
|
{
|
||||||
private $pattern;
|
private $pattern;
|
||||||
private $defaults;
|
private $defaults;
|
||||||
@ -55,6 +55,25 @@ class Route
|
|||||||
$this->compiled = null;
|
$this->compiled = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function serialize()
|
||||||
|
{
|
||||||
|
return serialize(array(
|
||||||
|
'pattern' => $this->pattern,
|
||||||
|
'default' => $this->default,
|
||||||
|
'requirements' => $this->requirements,
|
||||||
|
'options' => $this->options,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function unserialize($data)
|
||||||
|
{
|
||||||
|
$data = unserialize($data);
|
||||||
|
$this->pattern = $data['pattern'];
|
||||||
|
$this->default = $data['default'];
|
||||||
|
$this->requirements = $data['requirements'];
|
||||||
|
$this->options = $data['options'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the pattern.
|
* Returns the pattern.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user