Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.3755 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | 1 | public function run(Mapper $mapper, Filesystem $fs) |
|
12 | { |
||
13 | 1 | $filename = $fs->getPath('.cache/mapper-meta.php'); |
|
14 | |||
15 | 1 | $dir = dirname($filename); |
|
16 | 1 | if (!is_dir($dir)) { |
|
17 | 1 | mkdir($dir); |
|
18 | 1 | chown($dir, 'www-data'); |
|
19 | chgrp($dir, 'www-data'); |
||
20 | } |
||
21 | |||
22 | file_put_contents($filename, '<?php return '.var_export($mapper->getMeta(), true).';'); |
||
23 | chown($filename, 'www-data'); |
||
24 | chgrp($filename, 'www-data'); |
||
25 | } |
||
26 | } |
||
27 |