| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 3 | exec('rm -rf '.$this->config->getDataFolder().Recorder::LINKS_DIR); |
|
| 31 | mkdir($this->config->getDataFolder().Recorder::LINKS_DIR); |
||
| 32 | 3 | } |
|
| 33 | 3 | ||
| 34 | 3 | protected function getHarvester(Url $url) |
|
| 35 | 2 | { |
|
| 36 | 2 | if (false === $this->fromCache) { |
|
| 37 | 2 | return parent::getHarvester($url); |
|
| 38 | 2 | } |
|
| 39 | |||
| 40 | $filePath = $this->recorder->getCacheFilePath($url); |
||
| 41 | 2 | if (null !== $filePath && file_exists($filePath)) { |
|
| 42 | $response = new ResponseFromCache( |
||
| 43 | $filePath, |
||
| 44 | $this->config->getBase().$url->uri, |
||
| 45 | 3 | json_decode(file_get_contents($filePath.'---info'), true) |
|
| 46 | ); |
||
| 52 |