$MCache = new Memcached();
$Memcache = &$MCache;
$MCache->addSErver('/var/run/memcached.sock', 0);
$Re = new Redis();
$Re->connect('/var/run/redis/redis.sock');
?>
$Memcache = new Memcached();
$Memcache->addServer('/var/run/memcached.sock', 0);
$Redis = new Redis();
$Redis->connect('/var/run/redis/redis.sock');
class Push {
private $channel;
function __construct() {
global $Redis;
$this->channel = 'ANIZONE_GLOBAL';
$this->redis = &$Redis;
}
function channel($channel) {
$this->channel = $channel;
}
function trigger($event, $data, $channel = null) {
if($channel == null) $channel = $this->channel;
$json['channel'] = $channel;
$json['data']['event'] = $event;
$json['data']['data'] = $data;
$json = json_encode($json);
$this->redis->publish('juggernaut', $json);
}
}
class PushWing {
function queue($phone, $subject, $contents, $url, $timestamp = null) {
if($timestamp === null) $timestamp = time();
$odb = &oDB::getInstance();
$contents = str_replace( "
", '\n', $contents );
$contents = str_replace( "
", '\n', $contents );
$contents = str_replace( "
", '\n', $contents );
$contents = str_replace( "
", '\n', $contents );
$contents = strip_tags($contents);
$odb->insert('anizone_push_queue', ['phone' => $phone, 'subject' => $subject, 'contents' => $contents, 'url' => $url, 'timestamp' => $timestamp]);
}
function getGroupFavPhones($group_srl, $except_member_srl = []) {
$oCacheHandler = CacheHandler::getInstance('object');
$cache_key = 'anizone:group_fav_phones_cache:'.$group_srl;
$output = $oCacheHandler->get($cache_key);
if(!$output) {
$output = [];
$odb = &oDB::getInstance();
$list = $odb->select('xe_member_fav', ['target_srl' => $group_srl]);
$oMemberModel = &getModel('member');
foreach($list as $val) {
$mem = $oMemberModel->getMemberInfoByMemberSrl($val->member_srl);
if(in_array('즐겨찾기한 그룹의 새로운 글 작성', $mem->push_trigger) && is_array($mem->phone)) $output[] = implode('', $mem->phone);
}
$oCacheHandler->put($cache_key, $output);
}
foreach($except_member_srl as $except) {
if(($key = array_search($except, $output)) !== false) {
unset($messages[$key]);
}
}
$phone = implode(',', $output);
return $phone;
}
function clearGroupFavPhoneCache($group_srl) {
$oCacheHandler = CacheHandler::getInstance('object');
$cache_key = 'anizone:group_fav_phones_cache:'.$group_srl;
$oCacheHandler->delete($cache_key);
}
}
?>
자유 게시판
본문으로 바로가기
-
아 오랜만에 들어 왔는데 안타까워서 글 하나 올리고 감
-
AGF&리스애니 에 다녀왔습니다~
-
좋은글)어여쁜 꽃이 되렵니다
-
메리 크리스마스
-
메리 크리스마스
-
오랜만에 광고 글로 인하여 게시판이 활성화 됬네요.
-
홍콩 상대로 0:0...벤투 진짜 아니다.
-
미니카 산게 자랑입니다 ><
-
애니존 실험쥐를 만들었습니다.
-
모두 오랜만이에용?
-
dev.anizone.net 으로 대이주 ㄱㄱ
-
황우석 사건의 조금 수정된 평가
-
수박 이거 알고 있음?
-
이거 추가 되었음
-
섹광고스
-
수원 2019시즌 FA컵 우승!
-
너무 적절한 시식평
-
광고 지치지도 않나
-
가챠논문 근황
-
정신나간놈아 고만쎀ㅋㅋㅋㅋㅋㅋㅋ
-
쿄주요의교 사캬히쥬 밴 부탁드립니다
-
선생님들 여기 광고 올려도 아무도 안봅니다
-
워워 알았으니까 진정해
-
수술 끝났다!!
-
AGF&리스뮤직 갑니다 ><
-
은덩님 엣지에서 글이 안써져여
-
조커 보고왔습니다.
-
오 젭알 꿀팁같은거 필요없으니까
-
부의 편중 심화에 관하여
-
좀비랜드사가 베스트앨범 11월 27일 발매 & 신곡 뮤비 일부 공개
서버에 요청 중입니다. 잠시만 기다려 주십시오...