From 6eea97f1be663adab01463899a4c4c4b075f0abf Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 21 Apr 2017 02:37:01 +0200 Subject: [PATCH] DVL-005 Using non-persistent pg connect to prevent HHVM core-dump --- .devilbox/www/include/lib/Postgres.php | 6 +++--- .tests/.lib.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.devilbox/www/include/lib/Postgres.php b/.devilbox/www/include/lib/Postgres.php index c65aef5c..7897f17c 100644 --- a/.devilbox/www/include/lib/Postgres.php +++ b/.devilbox/www/include/lib/Postgres.php @@ -55,7 +55,7 @@ class Postgres // Silence errors and try to connect error_reporting(0); - $link = pg_pconnect('host='.$host.' user='.$user.' password='.$pass); + $link = pg_connect('host='.$host.' user='.$user.' password='.$pass); error_reporting(-1); if (!$link || pg_connection_status($link) !== PGSQL_CONNECTION_OK) { @@ -126,10 +126,10 @@ class Postgres // Silence errors and try to connect error_reporting(0); if ($database !== null) { - $link = pg_pconnect('host='.$host.' dbname='.$database.' user='.$user.' password='.$pass); + $link = pg_connect('host='.$host.' dbname='.$database.' user='.$user.' password='.$pass); } else { // NOTE: using dbname=postgres prevents HHVM from segfaulting - $link = pg_pconnect('host='.$host.' dbname=postgres user='.$user.' password='.$pass); + $link = pg_connect('host='.$host.' user='.$user.' password='.$pass); } error_reporting(-1); diff --git a/.tests/.lib.sh b/.tests/.lib.sh index d3583057..7e03f870 100644 --- a/.tests/.lib.sh +++ b/.tests/.lib.sh @@ -455,7 +455,7 @@ debilbox_test() { echo "log files" echo "------------------------------------------------------------" - find log -type f -exec sh -c 'echo "{}:\n-----------------"; cat "{}"' \; + find log -type f -exec sh -c 'echo "{}:\n-----------------"; cat "{}"; echo "\n\n"' \; return 1