Ignore:
Timestamp:
Dec 16, 2013 5:32:39 AM (11 years ago)
Author:
anonymous
Message:

Test existence of db_* values before loading env variables; disabled use of trigger_error in App::getParam(), although this may allow value missing issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch/lib/App.inc.php

    r447 r449  
    225225            return $this->_params[$param];
    226226        } else {
    227             trigger_error(sprintf('Parameter is not set: %s', $param), E_USER_NOTICE);
     227            /// trigger_error(sprintf('Parameter is not set: %s', $param), E_USER_NOTICE);
    228228            return null;
    229229        }
     
    275275
    276276            // DB connection parameters taken from environment variables in the httpd.conf file, readable only by root.
    277             if (!empty($_SERVER['DB_SERVER'])) {
     277            if (!empty($_SERVER['DB_SERVER']) && !$this->getParam('db_server')) {
    278278                $this->setParam(array('db_server' => $_SERVER['DB_SERVER']));
    279279            }
    280             if (!empty($_SERVER['DB_NAME'])) {
     280            if (!empty($_SERVER['DB_NAME']) && !$this->getParam('db_name')) {
    281281                $this->setParam(array('db_name' => $_SERVER['DB_NAME']));
    282282            }
    283             if (!empty($_SERVER['DB_USER'])) {
     283            if (!empty($_SERVER['DB_USER']) && !$this->getParam('db_user')) {
    284284                $this->setParam(array('db_user' => $_SERVER['DB_USER']));
    285285            }
    286             if (!empty($_SERVER['DB_PASS'])) {
     286            if (!empty($_SERVER['DB_PASS']) && !$this->getParam('db_pass')) {
    287287                $this->setParam(array('db_pass' => $_SERVER['DB_PASS']));
    288288            }
Note: See TracChangeset for help on using the changeset viewer.