$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);
}
}
?>
자유 게시판
본문으로 바로가기
-
우리도 가챠겜이나 만들어보죠
-
애니존 재오픈 게시판입니다.
-
먼데 먼데 또 살았어?
-
"낯선 천장이다"
-
컨텐츠가 없으니 넣어달라고 요청해야하나...
-
대학교에서 일하면서 느끼는점..
-
e-book은 참 좋은 물건이죠
-
신입받아라!!!
-
여러분 이번에는 진짜 콘을 넙쭈기로 바꾸겠습니다!
-
수업 발표에서 미친짓 하다가 교수님께 참교육 당했습니다...
-
안녕하세요 죄가 많은 사람입니다
-
님들 저 생일이에여
-
뉴비에요
-
다들 헤븐즈필 2부는 보셨나요
-
사키 세계관에 관해 작가님 블로그에 올라온 글
-
근황
-
레이와도 피해갈수없는 그것
-
이번 주는 그래도 행복하네요
-
어 휴대폰에서 글 써지네
-
요즘 다끝났어 때문에
-
엔드게임 보고 나니까..
-
설마 아직 안보신분 안계시겠죠! 타노스가!!
-
안뇨옹..
-
형들 누나들 안뇨옹?
-
캐나다 살아서 너무 행복했던 오덕의 주말
-
아쿠아~ 러브라이브선샤인 아시아투어 내한공연 다녀왔습니다~
-
주말 잘 보내고 계신가요?
-
은동쟝 언제 사이트 수리하실겁니까
-
우리집 차에 새똥이...
-
4년된 스마트폰을 떠나보내며...
서버에 요청 중입니다. 잠시만 기다려 주십시오...