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