Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / infrastructure / storage / xsprintf / queryfx.php
blobd1eef612b586961700d04392355e6ae14b19dd3f
1 <?php
3 function queryfx(AphrontDatabaseConnection $conn, $sql /* , ... */) {
4 $argv = func_get_args();
5 $query = call_user_func_array('qsprintf', $argv);
7 $conn->setLastActiveEpoch(time());
8 $conn->executeQuery($query);
11 function queryfx_all(AphrontDatabaseConnection $conn, $sql /* , ... */) {
12 $argv = func_get_args();
13 call_user_func_array('queryfx', $argv);
14 return $conn->selectAllResults();
17 function queryfx_one(AphrontDatabaseConnection $conn, $sql /* , ... */) {
18 $argv = func_get_args();
19 $ret = call_user_func_array('queryfx_all', $argv);
20 if (count($ret) > 1) {
21 throw new AphrontCountQueryException(
22 pht('Query returned more than one row.'));
23 } else if (count($ret)) {
24 return reset($ret);
26 return null;