File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Mathematicator \MandelbrotSet ;
6
6
7
+
8
+ use Nette \Utils \FileSystem ;
9
+
7
10
/**
8
11
* Calculate and render Mandelbrot set as image to file.
9
12
* Implementation is inspired by Pavol Hejny, https://www.pavolhejny.com/.
@@ -17,19 +20,11 @@ final class MandelbrotSet
17
20
18
21
/**
19
22
* @param string $tempDir
20
- * @throws \Exception
21
23
*/
22
24
public function __construct (string $ tempDir )
23
25
{
24
26
ini_set ('max_execution_time ' , '100000 ' );
25
-
26
- if (!is_dir ($ tempDir ) && !@mkdir ($ tempDir , 0777 , true ) && !is_dir ($ tempDir )) { // @ - dir may already exist
27
- throw new \Exception (
28
- 'Unable to create directory " ' . $ tempDir . '". '
29
- . preg_replace ('#^\w+\(.*?\): # ' , '' , error_get_last ()['message ' ])
30
- );
31
- }
32
-
27
+ FileSystem::createDir ($ tempDir );
33
28
$ this ->tempDir = $ tempDir ;
34
29
}
35
30
You can’t perform that action at this time.
0 commit comments