diff --git a/src/Geo.php b/src/Geo.php index 2f01378..61b906f 100644 --- a/src/Geo.php +++ b/src/Geo.php @@ -200,8 +200,14 @@ protected function initStores() protected function checkGeoPath() { - if (!is_dir(fwbase_path($this->firewall->dataPath . 'geodata'))) { - if (!mkdir(fwbase_path($this->firewall->dataPath . 'geodata'), 0777, true)) { + if (str_contains(__DIR__, '/vendor/')) { + $dataPath = $this->firewall->dataPath . 'geodata'; + } else { + $dataPath = fwbase_path($this->firewall->dataPath . 'geodata'); + } + + if (!is_dir($dataPath)) { + if (!mkdir($dataPath, 0777, true)) { return false; } } diff --git a/src/Indexes.php b/src/Indexes.php index bd0ef64..2fdc58b 100644 --- a/src/Indexes.php +++ b/src/Indexes.php @@ -251,8 +251,14 @@ protected function deleteIndexes() protected function checkIndexesPath() { - if (!is_dir(fwbase_path($this->firewall->dataPath . 'indexes'))) { - if (!mkdir(fwbase_path($this->firewall->dataPath . 'indexes'), 0777, true)) { + if (str_contains(__DIR__, '/vendor/')) { + $dataPath = $this->firewall->dataPath . 'indexes'; + } else { + $dataPath = fwbase_path($this->firewall->dataPath . 'indexes'); + } + + if (!is_dir($dataPath)) { + if (!mkdir($dataPath, 0777, true)) { return false; } }