$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);
}
}
?>
본문으로 바로가기
-
희대의 꼰대 상사
-
흨흨 가난한 한국팀은 웁니다..
-
흥흥흥흥!
-
흥흥흥~흥~흥~ 프레데리카~
-
흥민이라면 내 개인기록은 다 넘겠지만.
-
흥민이 잘하네요 ㅋㅋ
-
흥 그렇게 불쌍하게 생각하지 않아도 되거든
-
흡혈귀의 연애방법 체험판 후기
-
흡혈귀 vs 파문전사
-
흠... 레벨 등의 이야기가 나왔으니.. 추억담을 하나 놓아보자면은...
-
흠 컴퓨터를 한대 사려고하는데...컴퓨터 잘아시는분
-
흠 지금 쓰는덱은 마법상대로 가망이 없군요
-
흠 재생 빛벙 과회는 슬슬 끝물인건가
-
흔한_한국_애니메이션.jpg
-
흔한_칰빠들의_디스_방식.jpg
-
흔한_라노벨_신자의_반응
-
흔한_고기집_진상손님
-
흔한 폰게임의 사전등록.
-
흔한 포항유스의 박주영 mk2
-
흔한 투표 독려 포스터
-
흔한 통신사의 광고.
-
흔한 책 제목
-
흔한 일본의 극장판 애니 광고 클라스
-
흔한 일본 수출 게임의 캐스팅.jpg
-
흔한 이벤트
-
흔한 오버로드 팬의 애니화 완결까지의 과정
-
흔한 에바덕의 지름
-
흔한 어느 나라의 니트 코스프레...
-
흔한 아이기스의 유저
-
흔한 스테이크 1인분
서버에 요청 중입니다. 잠시만 기다려 주십시오...