From 60dabf781b09e5ea0087a17a772f4543416ccdfd Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Tue, 4 Jun 2019 14:28:09 -0400
Subject: [PATCH] Eliminate hard-coded .ini file list.

---
 module/VuFind/src/VuFind/Config/Upgrade.php | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/module/VuFind/src/VuFind/Config/Upgrade.php b/module/VuFind/src/VuFind/Config/Upgrade.php
index d8545d9f032..294337ac54b 100644
--- a/module/VuFind/src/VuFind/Config/Upgrade.php
+++ b/module/VuFind/src/VuFind/Config/Upgrade.php
@@ -292,11 +292,14 @@ class Upgrade
     {
         // Configuration files to load.  Note that config.ini must always be loaded
         // first so that getOldConfigPath can work properly!
-        $configs = [
-            'config.ini', 'authority.ini', 'facets.ini', 'geofeatures.ini',
-            'reserves.ini', 'searches.ini', 'Summon.ini', 'WorldCat.ini', 'sms.ini',
-            'permissions.ini', 'Collection.ini', 'Primo.ini'
-        ];
+        $configs = ['config.ini'];
+        foreach (glob($this->rawDir . '/*.ini') as $ini) {
+            $parts = explode('/', str_replace('\\', '/', $ini));
+            $filename = array_pop($parts);
+            if ($filename !== 'config.ini') {
+                $configs[] = $filename;
+            }
+        }
         foreach ($configs as $config) {
             // Special case for config.ini, since we may need to overlay extra
             // settings:
-- 
GitLab