xref: /PHP-8.0/ext/pgsql/tests/lcmess.inc (revision 7300f6fc)
1<?php
2
3function _skip_lc_messages($lc_messages = 'C')
4{
5    if (!_set_lc_messages($lc_messages)) {
6        die("skip Cannot set LC_MESSAGES to '{$lc_messages}'\n");
7    }
8}
9
10function _set_lc_messages($lc_messages = 'C')
11{
12    if (pg_fetch_result(pg_query("SHOW LC_MESSAGES"), 0, 0) != $lc_messages) {
13        if (!@pg_exec("SET LC_MESSAGES='{$lc_messages}'")) {
14            return false;
15        }
16    }
17
18    return true;
19}
20
21?>
22