Changeset 733 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Aug 15, 2020 11:16:58 PM (4 years ago)
Author:
anonymous
Message:

Add PDO connect retries. Minor fixes related to DB env vars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r732 r733  
    413413
    414414            // DB connection parameters taken from environment variables in the server httpd.conf file (readable only by root)

    415             if (!empty($_SERVER['DB_SERVER']) && !$this->getParam('db_server')) {
     415            if (isset($_SERVER['DB_SERVER']) && '' != $_SERVER['DB_SERVER'] && null === $this->getParam('db_server')) {
    416416                $this->setParam(array('db_server' => $_SERVER['DB_SERVER']));
    417417            }
    418             if (!empty($_SERVER['DB_NAME']) && !$this->getParam('db_name')) {
     418            if (isset($_SERVER['DB_NAME']) && '' != $_SERVER['DB_NAME'] && null === $this->getParam('db_name')) {
    419419                $this->setParam(array('db_name' => $_SERVER['DB_NAME']));
    420420            }
    421             if (!empty($_SERVER['DB_USER']) && !$this->getParam('db_user')) {
     421            if (isset($_SERVER['DB_USER']) && '' != $_SERVER['DB_USER'] && null === $this->getParam('db_user')) {
    422422                $this->setParam(array('db_user' => $_SERVER['DB_USER']));
    423423            }
    424             if (!empty($_SERVER['DB_PASS']) && !$this->getParam('db_pass')) {
     424            if (isset($_SERVER['DB_PASS']) && '' != $_SERVER['DB_PASS'] && null === $this->getParam('db_pass')) {
    425425                $this->setParam(array('db_pass' => $_SERVER['DB_PASS']));
    426426            }
Note: See TracChangeset for help on using the changeset viewer.