초콜릿 많이 드세요!
$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( "