Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $cacheAge=60;
- $memcache = new Memcache();
- $result = $_memcache->get('livechat_status');
- if (!$result)
- {
- try {
- $API = new LiveChat_API();
- $status = $API->status->get();
- $_memcache = new Memcache;
- $_memcache->connect('127.0.0.1', 11211);
- $_memcache->set('livechat_status', $status, false, $cacheAge);
- return $status;
- }
- catch (Exception $e) {
- die($e->getCode().' '.$e->getMessage());
- }
- }
- return result;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement