Conditions | 8 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
26 | public function __construct(string $name, string $context = 'app', string $appDir = '') |
||
27 | { |
||
28 | $this->name = $name; |
||
29 | $this->appDir = $appDir ?: $this->getAppDir($name); |
||
30 | $this->tmpDir = $this->appDir . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR . $context; |
||
31 | if (! file_exists($this->tmpDir) && ! @mkdir($this->tmpDir, 0777, true) && ! is_dir($this->tmpDir)) { |
||
32 | throw new NotWritableException($this->tmpDir); |
||
33 | } |
||
34 | |||
35 | $this->logDir = $this->appDir . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'log' . DIRECTORY_SEPARATOR . $context; |
||
36 | if (! file_exists($this->logDir) && ! @mkdir($this->logDir, 0777, true) && ! is_dir($this->logDir)) { |
||
37 | throw new NotWritableException($this->logDir); // @codeCoverageIgnore |
||
38 | } |
||
51 |