Skip to content

Commit cc6d056

Browse files
committed
Update drivers;
1 parent 748d424 commit cc6d056

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Drivers/BaseDriver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ abstract class BaseDriver implements SwaggerDriverContract
1010

1111
public function __construct()
1212
{
13-
$this->tempFilePath = storage_path('temp_documentation.json');
13+
$prodDir = config('auto-doc.documentation_directory');
14+
if (!is_dir($prodDir)) {
15+
mkdir($prodDir);
16+
}
17+
$this->tempFilePath = $prodDir.DIRECTORY_SEPARATOR.'temp_documentation.json';
1418
}
1519

1620
public function saveTmpData($data): void

src/Drivers/LocalDriver.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ class LocalDriver extends BaseDriver
1212
public function __construct()
1313
{
1414
parent::__construct();
15+
$this->prodFilePath = config('auto-doc.documentation_directory').DIRECTORY_SEPARATOR.config('auto-doc.drivers.local.production_path');
1516

16-
$this->prodFilePath = config('auto-doc.drivers.local.production_path');
17-
18-
if (empty($this->prodFilePath)) {
17+
if (!preg_match('/\/[\w]+\.json/ms',$this->prodFilePath)) {
1918
throw new MissedProductionFilePathException();
2019
}
2120
}

0 commit comments

Comments
 (0)