Example #1
0
 public function __construct($expiry_in_seconds = 1000)
 {
     if (self::$s_cache == null) {
         self::$s_cache = new myCache("objCache", $expiry_in_seconds);
         self::$s_memory_cache = new memoryCache();
     }
     $this->m_expiry_in_seconds = $expiry_in_seconds;
 }
Example #2
0
 public static function getPuserIdFromKuserId($partner_id, $kuser_id)
 {
     $cache = new myObjectCache();
     $key = $partner_id . "|" . $kuser_id;
     $puser_id = $cache->get("puser_kuser_id", $key);
     if ($puser_id == null) {
         $c = new Criteria();
         $c->add(self::PARTNER_ID, $partner_id);
         $c->add(self::KUSER_ID, $kuser_id);
         $puser_kusers = self::doSelect($c);
         if (count($puser_kusers) > 0) {
             $puser_kuser = $puser_kusers[0];
             $puser_id = $puser_kuser->getPuserId();
         } else {
             $puser_kuser = null;
             $puser_id = "null";
             // set the string null so this will be set in the cache
         }
         $cache->putValue("puser_kuser_id", $key, null, $puser_id);
     }
     if ($puser_id == "null") {
         return null;
     }
     // return the null object not the "null" string
     return $puser_id;
 }
Example #3
0
 public static function removePartnerFromCache($id)
 {
     $cache = new myObjectCache();
     $cache->remove(self::CLZZ, $id);
 }