$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);
}
}
?>
자유 게시판
본문으로 바로가기
-
내년에 복학합니다
-
신전
-
알라딘 티비로 봤는데, 재밌더라구요
-
이제는 펭귄한테도 까이는 그분..
-
광고 미쳤나
-
영화 반교:디텐션 보고 왔습니다.
-
국가대표 스리랑카전 선발 라인업
-
오랜만에 미니카를 사봤습니다 ><
-
카레메시 데키타요~
-
합정 애니플러스샵 다녀왔슴다~!
-
캐나다에 왔습니다.
-
대학원 생활 근황
-
입대합니다.
-
횽이 거기서 왜나와?!
-
반도리 필름라이브 정보가 떳습니다~ ><
-
프라이머리님 위로드리러 왔습니다
-
근황
-
밀리시타 한섭이 나왔는데 아무 얘기도 없네요
-
오디오 덕후 헤드폰 지른 거시애오..
-
다들 추석 잘 보내시고 살 찌세요
-
이런 시어머니면 레알 도망가야하지?
-
이젠 무슨 토토 어쩌구까지 오네
-
다들 명절날 이동편 잘 구하셨습니까?
-
월드컵 2차예선 투르크메니스탄전 선발 라인업
-
알라딘 티비로 보고 싶은데 아직도 상영중이네요
-
[스포]엑시트 보고왔습니다
-
광고가 랩1이 될 정도면 밴을 해도 되지 않을까?
-
죄송합니다
-
드디어 장학금이 들어왔습니다ㅠㅠ
-
뭐야 왜 광고글 안지워지죠
서버에 요청 중입니다. 잠시만 기다려 주십시오...