Ejemplo n.º 1
0
 protected function __construct($identity, $db = null)
 {
     if (!$db) {
         $db = Db::primary();
     }
     $this->db = $db;
     if (mt_rand(1, 200) === 1) {
         $this->maintenance();
     }
     $this->identity = $identity;
     $bans = unserialize(Cache::get('bans-' . $this->identity));
     if ($bans) {
         $this->banned($bans);
     }
     self::$banTypes = unserialize(Cache::get('table_ban_types'));
     if (!self::$banTypes) {
         self::$banTypes = $this->db->columnKey('name', 'ban_type', '1=1');
     }
 }