php 5.5 related adjustments
This commit is contained in:
@@ -74,7 +74,7 @@ if ($nr)
|
||||
{
|
||||
Memc::flush();
|
||||
$rp = $nr != 1 ? "reports" : "report";
|
||||
IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/");
|
||||
//IRCNotify::send("#SingularityViewer", "[CrashProcessor] $nr new $rp. http://crash.singularityviewer.org/");
|
||||
}
|
||||
|
||||
Session::GC();
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
class Comments
|
||||
{
|
||||
function updateCommentCount($id)
|
||||
static function updateCommentCount($id)
|
||||
{
|
||||
$q = kl_str_sql("update signature set has_comments=(select count(*) as count from comment where signature_id=!i) where id=!i", $id, $id);
|
||||
DBH::$db->query($q);
|
||||
Memc::flush();
|
||||
}
|
||||
|
||||
function addSignatureComment($id, $text)
|
||||
static function addSignatureComment($id, $text)
|
||||
{
|
||||
global $S;
|
||||
$q = kl_str_sql("insert into comment (signature_id, user_id, comment) values (!i, !i, !s)", $id, $S->user_id, $text);
|
||||
@@ -17,7 +17,7 @@ class Comments
|
||||
self::updateCommentCount($id);
|
||||
}
|
||||
|
||||
function getSignatureComments($id)
|
||||
static function getSignatureComments($id)
|
||||
{
|
||||
$ret = array();
|
||||
$q = kl_str_sql("select c.*, u.name, u.email from comment c join users u on c.user_id = u.user_id where signature_id=!i order by id asc;", $id);
|
||||
@@ -33,14 +33,14 @@ class Comments
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function delSignatureComment($id, $del_id)
|
||||
static function delSignatureComment($id, $del_id)
|
||||
{
|
||||
$q = kl_str_sql("delete from comment where id=!i", $del_id);
|
||||
DBH::$db->query($q);
|
||||
self::updateCommentCount($id);
|
||||
}
|
||||
|
||||
function renderComments($id)
|
||||
static function renderComments($id)
|
||||
{
|
||||
global $S;
|
||||
$comments = self::getSignatureComments($id);
|
||||
@@ -78,7 +78,7 @@ class Comments
|
||||
|
||||
|
||||
|
||||
function renderCommentPanel($id)
|
||||
static function renderCommentPanel($id)
|
||||
{
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class CrashReport
|
||||
|
||||
public static $all_signatures;
|
||||
|
||||
function htmlFrame($f, $chan, $version)
|
||||
static function htmlFrame($f, $chan, $version)
|
||||
{
|
||||
$urlBase = "https://github.com/singularity-viewer/SingularityViewer/blob/" . self::getHash($chan, $version);
|
||||
|
||||
@@ -67,7 +67,8 @@ class CrashReport
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
function getTotal($filter)
|
||||
|
||||
static function getTotal($filter)
|
||||
{
|
||||
$where = $filter->getWhere();
|
||||
$q = "select count(id) as total from reports $where";
|
||||
@@ -84,7 +85,7 @@ class CrashReport
|
||||
}
|
||||
}
|
||||
|
||||
function getReports($filter, $fields = "id, reported, client_version, client_channel, client_arch, os, gpu, grid, region, signature_id")
|
||||
static function getReports($filter, $fields = "id, reported, client_version, client_channel, client_arch, os, gpu, grid, region, signature_id")
|
||||
{
|
||||
$ret = array();
|
||||
$q = "select $fields from reports " . $filter->getWhere() . kl_str_sql(" order by id desc limit !i offset !i", $filter->limit, $filter->offset);
|
||||
@@ -106,7 +107,7 @@ class CrashReport
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function getReport($id)
|
||||
static function getReport($id)
|
||||
{
|
||||
$ret = array();
|
||||
if (!$res = DBH::$db->query(kl_str_sql("select * from reports where id=!i", $id)))
|
||||
|
||||
@@ -34,7 +34,7 @@ class DBH
|
||||
@fwrite($f, "[".date('Y-m-d H:i')."] ".$line."\n");
|
||||
}
|
||||
|
||||
function getInstance()
|
||||
static function getInstance()
|
||||
{
|
||||
if (self::$db === null)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
class Layout
|
||||
{
|
||||
|
||||
function getLoginGateway()
|
||||
static function getLoginGateway()
|
||||
{
|
||||
$assoc_handle_expires = (int)Option::get('assoc_handle_expires');
|
||||
$now = time();
|
||||
@@ -53,7 +53,7 @@ class Layout
|
||||
return GoogleOpenID::createRequest(URL_ROOT . "/process_login.php", $handle, true);
|
||||
}
|
||||
|
||||
function since($since)
|
||||
static function since($since)
|
||||
{
|
||||
$since = time() - $since;
|
||||
$chunks = array(
|
||||
@@ -175,7 +175,7 @@ class Layout
|
||||
<?php
|
||||
}
|
||||
|
||||
function footer()
|
||||
static function footer()
|
||||
{
|
||||
{ ?>
|
||||
<div style="margin-top:10px; padding: 5px;" class="ui-widget-header ui-corner-all">
|
||||
|
||||
@@ -5,7 +5,7 @@ class Memc
|
||||
static $active = false;
|
||||
static $expire = 7200;
|
||||
|
||||
function init()
|
||||
static function init()
|
||||
{
|
||||
if (!class_exists("Memcached", false)) return;
|
||||
|
||||
@@ -24,7 +24,7 @@ class Memc
|
||||
self::$active = true;
|
||||
}
|
||||
|
||||
function getq($q)
|
||||
static function getq($q)
|
||||
{
|
||||
if (!self::$active) return false;
|
||||
|
||||
@@ -32,7 +32,7 @@ class Memc
|
||||
return self::$mem->get($key);
|
||||
}
|
||||
|
||||
function setq($q, $data)
|
||||
static function setq($q, $data)
|
||||
{
|
||||
if (!self::$active) return false;
|
||||
|
||||
@@ -40,7 +40,7 @@ class Memc
|
||||
return self::$mem->set($key, $data, self::$expire);
|
||||
}
|
||||
|
||||
function flush()
|
||||
static function flush()
|
||||
{
|
||||
if (!self::$active) return false;
|
||||
self::$mem->flush();
|
||||
|
||||
@@ -35,7 +35,7 @@ class ReportParser
|
||||
{
|
||||
static $extracted = array();
|
||||
|
||||
function parse($id)
|
||||
static function parse($id)
|
||||
{
|
||||
$q = kl_str_sql("select * from raw_reports where report_id=!i", $id);
|
||||
if (!$res = DBH::$db->query($q) OR !$row = DBH::$db->fetchRow($res))
|
||||
|
||||
@@ -3,7 +3,7 @@ if (!defined('SITE_ROOT')) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
error_reporting(E_ALL ^ E_NOTICE);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT));
|
||||
ini_set('display_errors',1);
|
||||
|
||||
if (!extension_loaded('kl')) {
|
||||
|
||||
Reference in New Issue
Block a user