Total Complexity | 3 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class FileSerializedResourcePersistenceHandler extends FilePersistenceHandler implements PersistenceHandlerInterface |
||
14 | { |
||
15 | public function persist(Resource $resource) |
||
16 | { |
||
17 | $path = $this->getResultPath() . $this->getFileSystemPath($resource); |
||
18 | if (!is_dir($path)) { |
||
19 | mkdir($path, 0777, true); |
||
20 | } |
||
21 | $file = new \SplFileObject($path . DIRECTORY_SEPARATOR . $this->getFileSystemFilename($resource), 'w'); |
||
22 | $this->totalSizePersisted += $file->fwrite(serialize($resource)); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * @return Resource |
||
27 | */ |
||
28 | public function current() |
||
31 | } |
||
32 | } |
||
33 |