| Conditions | 8 |
| Paths | 6 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function __construct(string $name, string $context = 'app', string $appDir = '') |
||
| 18 | { |
||
| 19 | $this->name = $name; |
||
| 20 | $this->appDir = $appDir ?: $this->getAppDir($name); |
||
| 21 | $this->tmpDir = $this->appDir . '/var/tmp/' . $context; |
||
| 22 | if (! file_exists($this->tmpDir) && ! @mkdir($this->tmpDir, 0777, true) && ! is_dir($this->tmpDir)) { |
||
| 23 | throw new NotWritableException($this->tmpDir); |
||
| 24 | } |
||
| 25 | $this->logDir = $this->appDir . '/var/log/' . $context; |
||
| 26 | if (! file_exists($this->logDir) && ! @mkdir($this->logDir, 0777, true) && ! is_dir($this->logDir)) { |
||
| 27 | throw new NotWritableException($this->logDir); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 41 |