Author: ralfbecker
New Revision: 55448
URL: http://svn.stylite.de/viewvc/egroupware?rev=55448&view=rev
Log:
move egw_json_(request|response|push) to api, missing commit of notifications_push class
Modified:
trunk/notifications/inc/class.notifications_push.inc.php
— trunk/notifications/inc/class.notifications_push.inc.php (original)
+++ trunk/notifications/inc/class.notifications_push.inc.php Sun Mar 20 17:45:42 2016
@@ -10,13 +10,14 @@
-// egw_json_push_backend is currently not autoloaded, it would only try egw_json for it!
-require_once(EGW_API_INC.’/class.egw_json_push.inc.php’);
+use EGroupware\Api\Json;
+
+use EGroupware\Api;
/**
- Class to push via notification polling and other json requests from client-side
*/
-class notifications_push implements egw_json_push_backend
+class notifications_push implements Json\PushBackend
{
const APP = ‘notifications’;
@@ -39,8 +40,8 @@
public static function get()
{
-
$already_send =& egw_cache::getSession(__CLASS__, 'already_send');
-
$max_id = egw_cache::getInstance(__CLASS__, 'max_id');
-
$already_send =& Api\Cache::getSession(__CLASS__, 'already_send');
-
$max_id = Api\Cache::getInstance(__CLASS__, 'max_id');
if (!isset($already_send))
{
@@ -49,13 +50,13 @@
if (!isset($max_id))
{
$max_id = (int)self::$db->select(self::TABLE, ‘MAX(notify_id)’, false, LINE, FILE, false, ‘’, self::APP)->fetchColumn();
-
$response = Json\Response::get();
foreach(self::$db->select(self::TABLE, '*', array(
'account_id' => array(0, $GLOBALS['egw_info']['user']['account_id']),
@@ -86,9 +87,9 @@
public function addGeneric($account_id, $key, $data)
{
// todo: check $account_id is online
@@ -100,7 +101,7 @@
), false, LINE, FILE, self::APP);
// cache highest id, to not poll database
-
egw_cache::setInstance(__CLASS__, 'max_id', self::$db->get_last_insert_id(self::TABLE, 'notify_id'));
-
Api\Cache::setInstance(__CLASS__, 'max_id', self::$db->get_last_insert_id(self::TABLE, 'notify_id'));
self::cleanup_push_msgs();
}
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs