From a7ceaee1e3499d5350a97a9a397aa04cbe337cb5 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 8 Sep 2013 23:36:03 -0700 Subject: [PATCH] Web: fix PHP warnings --- html/inc/boinc_db.inc | 4 ++-- html/inc/db_ops.inc | 42 +++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/html/inc/boinc_db.inc b/html/inc/boinc_db.inc index d652e4fc84..fbf5853618 100644 --- a/html/inc/boinc_db.inc +++ b/html/inc/boinc_db.inc @@ -158,7 +158,7 @@ class BoincUser { $db->delete_aux('profile', "userid=$this->id"); return $db->delete($this, 'user'); } - function sum($field) { + static function sum($field) { $db = BoincDb::get(); return $db->sum('user', $field); } @@ -321,7 +321,7 @@ class BoincApp { $db = BoincDb::get(); return $db->update($this, 'app', $clause); } - function sum($field) { + static function sum($field) { $db = BoincDb::get(); return $db->sum('app', $field); } diff --git a/html/inc/db_ops.inc b/html/inc/db_ops.inc index ec8e9a578d..31d2aafc58 100644 --- a/html/inc/db_ops.inc +++ b/html/inc/db_ops.inc @@ -16,6 +16,8 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . +// TODO: most of this code shouldn't exist. + error_reporting(E_ALL); ini_set('display_errors', true); ini_set('display_startup_errors', true); @@ -578,7 +580,7 @@ function server_state_select() { "; - for($i=0; $i<8; $i++) { + for ($i=0; $i<8; $i++) { $res = new StdClass; $res->outcome = $i; $res->exit_status = 0; @@ -605,11 +607,11 @@ function validate_state_select() { \n"; } @@ -619,7 +621,7 @@ function client_state_select() {