Annotation of embedaddon/php/ext/pgsql/tests/skipif.inc, revision 1.1
1.1 ! misho 1: <?php
! 2: // This script prints "skip" unless:
! 3: // * the pgsql extension is built-in or loadable, AND
! 4: // * there is a database called "test" accessible
! 5: // with no username/password, AND
! 6: // * we have create/drop privileges on the entire "test"
! 7: // database
! 8:
! 9: include("config.inc");
! 10: include("lcmess.inc");
! 11:
! 12: if (!extension_loaded("pgsql")) {
! 13: die("skip\n");
! 14: }
! 15: $conn = @pg_connect($conn_str);
! 16: if (!is_resource($conn)) {
! 17: die("skip could not connect\n");
! 18: }
! 19:
! 20: function skip_server_version($version, $op = '<') { _skip_version('server', $version, $op); }
! 21: function skip_client_version($version, $op = '<') { _skip_version('client', $version, $op); }
! 22:
! 23:
! 24: function _skip_version($type, $version, $op)
! 25: {
! 26: $pg = pg_parameter_status($type.'_version');
! 27: if (version_compare($pg, $version, $op)) {
! 28: die("skip {$type} version {$pg} is {$op} {$version}\n");
! 29: }
! 30: }
! 31:
! 32: ?>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>