[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] config: Fix fatal error on missing or unreadable config file by defining...
"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a0c9c4d4eab4_3819193c21425@gitlab-sidekiq-low-urgency-cpu-bound-v2-57bdc66575-vwn9n.mail> |
Jonny Bradley pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
01c10e72 by Jonny Bradley at 2026-05-19T17:04:14+00:00
[FIX] config: Fix fatal error on missing or unreadable config file by defining a var before using it
---
* [FIX] config: Fix fatal error on missing or unreadable config file by defining the `$fail` closure before using it.
Regression from !8574 i believe.
See merge request tikiwiki/tiki!10252
- - - - -
1 changed file:
- db/tiki-db.php
Changes:
=====================================
db/tiki-db.php
=====================================
@@ -18,6 +18,20 @@ use Tiki\TikiInit;
require_once('lib/init/initlib.php');
+$fail = static function (string $msg, int $code = 1001): void {
+ if (defined('TIKI_CONSOLE')) {
+ throw new ConsoleSetupException($msg, $code);
+ }
+ if (PHP_SAPI === 'cli') {
+ fwrite(STDERR, $msg . PHP_EOL);
+ exit(1);
+ }
+ header('HTTP/1.0 503 Service Unavailable', true, 503);
+ header('Retry-After: 300');
+ echo $msg;
+ exit(1);
+};
+
// Define lang and load translation functions
if (! empty($_REQUEST['lang'])) {
$language = $prefs['site_language'] = $prefs['language'] = $_REQUEST['lang'];
@@ -286,17 +300,3 @@ function mydumpstack($stack)
}
return $o;
}
-
-$fail = static function (string $msg, int $code = 1001): void {
- if (defined('TIKI_CONSOLE')) {
- throw new ConsoleSetupException($msg, $code);
- }
- if (PHP_SAPI === 'cli') {
- fwrite(STDERR, $msg . PHP_EOL);
- exit(1);
- }
- header('HTTP/1.0 503 Service Unavailable', true, 503);
- header('Retry-After: 300');
- echo $msg;
- exit(1);
-};
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/01c10e7202e90bc980114b8374f648a9de21ecff
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/01c10e7202e90bc980114b8374f648a9de21ecff
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs