$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);
}
}
?>
자유 게시판
본문으로 바로가기
-
물장판을 본 럽폭도의 최후
-
졸업식 왔습니다
-
오늘은 밸런타인데이입니다.
-
디시 접속 안되네요.
-
끓어오르는 럽뽕에의해 질러버린 피규어가 왔네요
-
사진한장으로 4개의 대학찍기
-
???:린코쨩은 스타크래프트 주 종족이 뭐야?
-
국사모...결국 마시로와 유키노는..
-
국사모 다시 투표~~
-
[지진속보] 경북 포항시 인근 지진 발생
-
국사모 투표 했다요~ㅅ~
-
여러분 모두 즐거운 설연휴 되시길 바랍니다
-
손들어! 움직이지마!
-
한국 돌아왔습니다
-
뻘뻘글 마이크 산 게 자랑
-
수백일만에 강림
-
자동전투 너무 좋다.
-
국사모 투표했습니다
-
국사모 결승은 콩라인 데스매치를 보고싶네요.
-
국사모 투표
-
소녀전선) 기쁨의 뻘글
-
Aㅏ... 피규어 너무 잘나온거같은데말이죠 으으
-
새해 복 많이 받으세요
-
인터라켄에 도착했습니다
-
독일은 맥주국이 맞습니다
-
연휴 시작!! 즐거운 설 연휴되세욤!
-
뻘글 싸자고 하고 까먹음
-
???:어이 대한민국 들어라
-
와 이곳이 아직도 운영됨?
-
뮌헨에 도착했습니다ㅎㅎ
서버에 요청 중입니다. 잠시만 기다려 주십시오...