Skip to content

Commit 919625f

Browse files
committed
bug fix
1 parent c60c0fe commit 919625f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ApiDocGenerator.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use yii\base\Application;
1515
use yii\base\Component;
1616
use yii\base\Controller;
17-
17+
use Yii;
1818

1919

2020

@@ -337,8 +337,12 @@ private function insert($str)
337337
*/
338338
private function loadGeneratedDocs()
339339
{
340+
$dataDir = Yii::getAlias($this->docDataAlias);
341+
342+
343+
if (!file_exists($dataDir)) { mkdir($dataDir, 0777, true); }
340344

341-
$d = dir(Yii::getAlias($this->docDataAlias));
345+
$d = dir($dataDir);
342346
while($file = $d->read()) { // do this for each file in the directory
343347
if ($file != "." && $file != "..") { // to prevent an infinite loop
344348
$this->docs[$file] = true;

0 commit comments

Comments
 (0)