Download src/php/php-src/ext/pgsql/tests/80_bug36625.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 923 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/80_bug36625.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pgsql/tests/80_bug36625.phpt
-
curl -L -o 80_bug36625.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pgsql/tests/80_bug36625.phpt
923 Bytes
| --TEST-- | |
| Bug #36625 (8.0+) (pg_trace() does not work) | |
| --EXTENSIONS-- | |
| pgsql | |
| --SKIPIF-- | |
| require_once('inc/skipif.inc'); | |
| --FILE-- | |
| require_once('inc/config.inc'); | |
| $dbh = @pg_connect($conn_str); | |
| if (!$dbh) { | |
| die ('Could not connect to the server'); | |
| } | |
| $tracefile = __DIR__ . '/trace.tmp'; | |
| @unlink($tracefile); | |
| var_dump(file_exists($tracefile)); | |
| pg_trace($tracefile, 'w', $dbh); | |
| $res = pg_query($dbh, 'SELECT 1'); | |
| var_dump($res); | |
| pg_close($dbh); | |
| $found = 0; | |
| function search_trace_file($line) | |
| { | |
| if (strpos($line, '"SELECT 1"') !== false || strpos($line, "'SELECT 1'") !== false) { | |
| $GLOBALS['found']++; | |
| } | |
| } | |
| $trace = file($tracefile); | |
| array_walk($trace, 'search_trace_file'); | |
| var_dump($found > 0); | |
| var_dump(file_exists($tracefile)); | |
| --CLEAN-- | |
| $tracefile = __DIR__ . '/trace.tmp'; | |
| unlink($tracefile); | |
| --EXPECTF-- | |
| bool(false) | |
| object(PgSql\Result)#%d (0) { | |
| } | |
| bool(true) | |
| bool(true) | |