Conditions | 4 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php namespace Mascame\Artificer; |
||
14 | public static function store(\Intervention\Image\Image $image, $path = null, $quality = null) |
||
15 | { |
||
16 | if (!$path) { |
||
17 | $pathinfo = pathinfo($path); |
||
18 | $path = $pathinfo['dirname']; |
||
19 | } |
||
20 | |||
21 | if (!file_exists($path)) { |
||
22 | File::makeDirectory($path, 0777, true, true); |
||
23 | } |
||
24 | |||
25 | $filename = $path . $image->filename . '.' . $image->extension; |
||
26 | |||
27 | if (!file_exists($filename)) { |
||
28 | return $image->save($filename, $quality); |
||
29 | } |
||
30 | |||
31 | return false; |
||
32 | } |
||
33 | |||
44 | } |