|
18 | 18 | * @package WordPress |
19 | 19 | */ |
20 | 20 |
|
21 | | -require_once __DIR__ . '/config/memory.php'; |
22 | | -require_once __DIR__ . '/config/salts.php'; |
23 | | -require_once __DIR__ . '/config/content.php'; |
24 | | -require_once __DIR__ . '/config/database.php'; |
25 | | -require_once __DIR__ . '/config/plugins.php'; |
26 | | -require_once __DIR__ . '/config/update.php'; |
27 | | -require_once __DIR__ . '/config/upload.php'; |
28 | | -require_once __DIR__ . '/config/cron.php'; |
29 | | - |
30 | | -/** |
31 | | - * Active directory configuration |
32 | | - * |
33 | | - * Configuration for the active directory login functionality |
34 | | - */ |
35 | | -if (file_exists(__DIR__ . '/config/ad.php')) { |
36 | | - require_once __DIR__ . '/config/ad.php'; |
37 | | -} |
38 | | - |
39 | | -/** |
40 | | - * Search concfiguration |
41 | | - * |
42 | | - * Configuration for the search functionality |
43 | | - */ |
44 | | -if (file_exists(__DIR__ . '/config/search.php')) { |
45 | | - require_once __DIR__ . '/config/search.php'; |
46 | | -} |
47 | | - |
48 | 21 | /** |
49 | | - * Sentry error tracking. |
| 22 | + * Config files |
50 | 23 | * |
51 | | - * Configuration for the error tracking functionality |
| 24 | + * All declared configuration files are loaded if they exist. |
52 | 25 | */ |
53 | | -if (file_exists(__DIR__ . '/config/sentry.php')) { |
54 | | - require_once __DIR__ . '/config/sentry.php'; |
55 | | -} |
| 26 | +$configFiles = [ |
| 27 | + 'memory.php', |
| 28 | + 'salts.php', |
| 29 | + 'content.php', |
| 30 | + 'database.php', |
| 31 | + 'plugins.php', |
| 32 | + 'update.php', |
| 33 | + 'upload.php', |
| 34 | + 'cron.php', |
| 35 | + 'ad.php', |
| 36 | + 'search.php', |
| 37 | + 'sentry.php', |
| 38 | + 'cookie.php', |
| 39 | + 'cache.php', |
| 40 | + 'scripts.php', |
| 41 | + 'multisite.php', |
| 42 | + 'developer.php', |
| 43 | + 'tideways.php', |
| 44 | +]; |
56 | 45 |
|
57 | | -/** |
58 | | - * Cookie settings |
59 | | - * |
60 | | - * To enable this site as a multisite please rename the config/cookie-example.php file to |
61 | | - * cookie.php, then go ahead and edit the configurations |
62 | | - */ |
63 | | -if (file_exists(__DIR__ . '/config/cookie.php')) { |
64 | | - require_once __DIR__ . '/config/cookie.php'; |
65 | | -} |
| 46 | +foreach ($configFiles as $configFile) { |
| 47 | + $configPath = __DIR__ . '/config/' . $configFile; |
66 | 48 |
|
67 | | -/** |
68 | | - * Cache settings |
69 | | - * |
70 | | - * To enable this site as a multisite please rename the config/cache-example.php file to |
71 | | - * cache.php, then go ahead and edit the configurations |
72 | | - */ |
73 | | -if (file_exists(__DIR__ . '/config/cache.php')) { |
74 | | - require_once __DIR__ . '/config/cache.php'; |
| 49 | + if (file_exists($configPath)) { |
| 50 | + require_once $configPath; |
| 51 | + } |
75 | 52 | } |
76 | 53 |
|
77 | | -/** |
78 | | - * Script settings |
79 | | - */ |
80 | | -if (file_exists(__DIR__ . '/config/scripts.php')) { |
81 | | - require_once __DIR__ . '/config/scripts.php'; |
82 | | -} |
83 | | - |
84 | | -/** |
85 | | - * Multisite settings |
86 | | - * |
87 | | - * To enable this site as a multisite please rename the config/multisite-example.php file to |
88 | | - * multisite.php, then go ahead and edit the configurations |
89 | | - */ |
90 | | -if (file_exists(__DIR__ . '/config/multisite.php')) { |
91 | | - require_once __DIR__ . '/config/multisite.php'; |
92 | | -} |
93 | | - |
94 | | -/** |
95 | | - * Developer settings |
96 | | - * |
97 | | - * You can create a file called "developer.php" in the config dir and |
98 | | - * put your dev-stuff and overrides inside. |
99 | | - */ |
100 | | -if (file_exists(__DIR__ . '/config/developer.php')) { |
101 | | - require_once __DIR__ . '/config/developer.php'; |
102 | | -} |
103 | | - |
104 | | -/** |
105 | | - * Tideways settings |
106 | | - * |
107 | | - * You can create a file called "tideways.php" in the config dir and |
108 | | - * put your tideways configurations inside. |
109 | | - */ |
110 | | -if (file_exists(__DIR__ . '/config/tideways.php')) { |
111 | | - require_once __DIR__ . '/config/tideways.php'; |
112 | | -} |
113 | | - |
114 | | - |
115 | 54 | /* That's all, stop editing! Happy blogging. */ |
116 | 55 |
|
117 | 56 | /** Absolute path to the WordPress directory. */ |
|
0 commit comments