コード例 #1
0
ファイル: class.hall_of_fame.php プロジェクト: Kuzat/kofradia
 /**
  * Hent, evt. generer, cache
  */
 public static function cache_load($reload = false)
 {
     if (!$reload) {
         $data = cache::fetch("hall_of_fame");
         if ($data) {
             self::$data = $data;
             return;
         }
     }
     $data = self::get_data_structure();
     // hent fra databasen
     $result = \Kofradia\DB::get()->query("\n\t\t\tSELECT hof_id, hof_name, hof_sub, hof_time, hof_data\n\t\t\tFROM hall_of_fame");
     while ($row = $result->fetch()) {
         $data[$row['hof_name']][$row['hof_sub'] ?: 0] = array($row['hof_time'], unserialize($row['hof_data']));
     }
     cache::store("hall_of_fame", $data, 900);
     self::$data = $data;
 }