$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);
}
}
?>
자유 게시판
본문으로 바로가기
-
미세먼지 보통만되도
-
미세먼지 ㅠ 어마어마하네요.
-
누가 은동 보러 갔다가 싸이오닉스톰 시전하고 왔나요.
-
클럽박스 이 ㄱㅅㄲ들아!!! ㅆㅂㅅㄲ들아!!!
-
솔직히 애니존은 답이 없다 생각하는게...
-
난생처음 펀드들고 왔습니다
-
늅
-
친구 대리고 물장판 또보고온;;
-
애니존은 죽지 않아따
-
사이트가 죽으면 뭐 어때요
-
요즘 덕후들 사이에서 인기인 물장판
-
아쿠아 내한공연 예매 성공~!!
-
친구따라 강남...아니 고려대가기
-
애니존 오랜만
-
왜 오늘따라 새로운 글을 찾아요
-
분실물 찾습니다..
-
오늘 K리그1 경기 리뷰
-
아 애니존 또 망했네
-
[럽폭주의] 4집 센터 결과가 나왔군요
-
오늘 삼일절인데
-
3.1일절입니다.. 오늘만큼은 ..
-
라스트 오리진 평가)
-
김거냥뉨은 제가 보낸 카톡을 보고 답변을 해주세요 'ㅅ';;;
-
국시 합격 인증합니다
-
제주도 소녀 샛별이
-
뒹굴뒹굴. 뒹굴뒹굴
-
물장판)아쿠아랑 같은프로그램씁니다 ㅎㅎ 이것도 스포이려나...
-
수강신청을 해야하는데...(절망편)
-
여러분 사가를 살려야 합니다
-
물장판을 본 럽폭도의 최후
서버에 요청 중입니다. 잠시만 기다려 주십시오...