]> granicus.if.org Git - php/commitdiff
Added PGSQL_TEST_CONNSTR env var support for ext/pgsql tests
authorMatteo Beccati <mbeccati@php.net>
Fri, 31 Oct 2014 17:54:16 +0000 (18:54 +0100)
committerMatteo Beccati <mbeccati@php.net>
Fri, 31 Oct 2014 17:54:16 +0000 (18:54 +0100)
ext/pgsql/tests/config.inc

index d4bbb33824912e90301b21b4fcb55290f563320f..224d0550873d0dfd4be098cdb1a5707dc06ef436 100644 (file)
@@ -1,12 +1,15 @@
 <?php
+
 // These vars are used to connect db and create test table.
-// values can be set to meet your environment
+// values can be set to meet your environment with the
+// environment var PGSQL_TEST_CONNSTR
+
+$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432";    // connection string
 
-$conn_str = "host=localhost dbname=test port=5432";    // connection string
 $table_name = "php_pgsql_test";  // test table that should be exist
 $num_test_record = 1000;         // Number of records to create
 
 $table_def = "CREATE TABLE php_pgsql_test (num int, str text, bin bytea);"; // Test table 
 $field_name = "num";             // For pg_field_num()
 
-?>
\ No newline at end of file
+?>