DVL-005 Using non-persistent pg connect to prevent HHVM core-dump

This commit is contained in:
cytopia 2017-04-21 02:37:01 +02:00
parent 8295e1ac18
commit 6eea97f1be
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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