From 39a57c07eb9d25c261e412ab3db7bbad39067d6b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 5 Apr 2016 12:10:40 -0700 Subject: [PATCH] PHP code: avoid using a global var --- html/inc/boinc_db.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/html/inc/boinc_db.inc b/html/inc/boinc_db.inc index 5d299efcd3..8c29ad3440 100644 --- a/html/inc/boinc_db.inc +++ b/html/inc/boinc_db.inc @@ -16,9 +16,13 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -$d = dirname(__FILE__); -require_once("$d/db_conn.inc"); -require_once("$d/util_basic.inc"); +function incs() { + $d = dirname(__FILE__); + require_once("$d/db_conn.inc"); + require_once("$d/util_basic.inc"); +} + +incs(); class BoincDb extends DbConn { static $instance;