Esempio n. 1
0
 private static function get_kings()
 {
     if (self::$kings === null) {
         $cache = StudipCacheFactory::getCache();
         # read cache (unserializing a cache miss - FALSE - does not matter)
         $kings = unserialize($cache->read(self::CACHE_KEY));
         # cache miss, retrieve from database
         if ($kings === FALSE) {
             $kings = self::get_kings_uncached();
             # write to cache with an expiry time of 24 hours
             $cache->write(self::CACHE_KEY, serialize($kings), 86400);
         }
         self::$kings = $kings;
     }
     return self::$kings;
 }