Skip to content

Commit

Permalink
Fix: look for *.pak files only to backup morphology and avoid backing…
Browse files Browse the repository at this point in the history
… it all
  • Loading branch information
donhardman committed Jul 9, 2024
1 parent fa1fecd commit 634e201
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Lib/ManticoreConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 634e201

Please sign in to comment.