$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);
}
}
?>
자유 게시판
본문으로 바로가기
-
모바일 이미지 업로드 곤칠수없나요?
-
뉨들 프라하 오니까 발포 비타민이 정말 싸요
-
광고다! 광고가 나타났다!
-
저도 유럽 가고싶어요
-
저는 지금 프라하입니다
-
하루만에 데이터 다 날리고 돈도 더 나왔네여...
-
아시안컵 카타르전 선발 라인업
-
저는 지금 독일 아우토반에 있습니다
-
약사 국시 보고 왔습니다.
-
뿌우직
-
하루 한번 뻘글이나 싸보자
-
유우럽 갑니다
-
아시안컵 바레인전 선발 라인업
-
스쿠페스 한섭이망했네요...?
-
지난 두 경기에서 암걸렸다가 오늘 경기로 다 나은 느낌.
-
아시안컵 중국전 선발 라인업
-
럽라뽕이 차서 럽라를 다시보는데 말이죠
-
요즘 갑자기 러브라이브가 다시 끌리는데
-
신년에는 건강을 더 챙겨야....
-
신년에는 거창한 목표가 생겼어요
-
오마에....좀랜사를 아직도 안봤다고...?
-
아시안컵 키르기스스탄전 선발 라인업
-
디시가 아퍼요.
-
학교 도서관에 디지캐럿 파뇨파뇨
-
???: 어이... 1대0...?
-
아시안컵 필리핀전 선발 라인업
-
애니존아 죽지마ㅠㅠ
-
수술 성공했네...
-
애니존 살아 돌아와서 다행이네요
-
이미지가 안올라가...
서버에 요청 중입니다. 잠시만 기다려 주십시오...