diff --git a/src/Lib/ManticoreConfig.php b/src/Lib/ManticoreConfig.php index e809000..7b9f072 100644 --- a/src/Lib/ManticoreConfig.php +++ b/src/Lib/ManticoreConfig.php @@ -184,8 +184,20 @@ public function getStatePaths(): array { $result[] = $this->sphinxqlState; } + // Lemmatizer base is a directory of modules by default + // so we are looking for .pak files in it and add only those + // to prevent adding all files in the directory that should not be backed up if (isset($this->lemmatizerBase) && is_dir($this->lemmatizerBase)) { - $result[] = $this->lemmatizerBase; + $files = glob($this->lemmatizerBase . '/*.pak'); + if ($files) { + foreach ($files as $file) { + if (!is_file($file)) { + continue; + } + + $result[] = $file; + } + } } return $result;