File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
src/Symfony/Component/Config/Resource Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 16
16
*
17
17
* @author Fabien Potencier <fabien@symfony.com>
18
18
*/
19
- class DirectoryResource implements ResourceInterface
19
+ class DirectoryResource implements ResourceInterface, \Serializable
20
20
{
21
21
private $ resource ;
22
22
private $ pattern ;
@@ -89,4 +89,14 @@ public function isFresh($timestamp)
89
89
90
90
return $ newestMTime < $ timestamp ;
91
91
}
92
+
93
+ public function serialize ()
94
+ {
95
+ return serialize (array ($ this ->resource , $ this ->pattern ));
96
+ }
97
+
98
+ public function unserialize ($ serialized )
99
+ {
100
+ list ($ this ->resource , $ this ->pattern ) = unserialize ($ serialized );
101
+ }
92
102
}
Original file line number Diff line number Diff line change 18
18
*
19
19
* @author Fabien Potencier <fabien@symfony.com>
20
20
*/
21
- class FileResource implements ResourceInterface
21
+ class FileResource implements ResourceInterface, \Serializable
22
22
{
23
23
private $ resource ;
24
24
@@ -67,4 +67,14 @@ public function isFresh($timestamp)
67
67
68
68
return filemtime ($ this ->resource ) < $ timestamp ;
69
69
}
70
+
71
+ public function serialize ()
72
+ {
73
+ return serialize ($ this ->resource );
74
+ }
75
+
76
+ public function unserialize ($ serialized )
77
+ {
78
+ $ this ->resource = unserialize ($ serialized );
79
+ }
70
80
}
You can’t perform that action at this time.
0 commit comments