Skip to content

Commit

Permalink
feat: resource-layout indexer config location
Browse files Browse the repository at this point in the history
  • Loading branch information
sitepark-veltrup committed Apr 15, 2024
1 parent 57de5c5 commit 956eb4a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Service/Indexer/IndexerConfigurationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public function loadAll(): array
{
$dir = $this->resourceBaseLocator->locate() . '/indexer';
if (!is_dir($dir)) {
$dir = $this->resourceBaseLocator->locate() . '/../configs/indexer';
}
if (!is_dir($dir)) {
echo $dir . " not found \n";
return [];
}

Expand All @@ -38,8 +42,13 @@ public function loadAll(): array

private function getFile(string $source): string
{
return $this->resourceBaseLocator->locate() .
$file = $this->resourceBaseLocator->locate() .
'/indexer/' . $source . '.php';
if (file_exists($file)) {
return $file;
}
return $this->resourceBaseLocator->locate() .
'/../configs/indexer/' . $source . '.php';
}

public function exists(string $source): bool
Expand Down

0 comments on commit 956eb4a

Please sign in to comment.