Exemple #1
0
        $data = array();
        $data['t'] = time();
        $data['h'] = self::ih($data['t']);
        $fp = fopen(DIR_CACHE . 'sumo.guard.data', 'w+');
        fwrite($fp, json_encode($data));
        fclose($fp);
    }
    // Internal hashing function
    private static function ih($t)
    {
        return strtoupper(sha1(strrev($t)));
    }
    // Internal time function to check if the given time is bigger/lower than the current
    private static function it($t)
    {
        $t = (int) $t;
        if (empty($t) || $t + rand(1, 24) * 3600 <= time()) {
            return false;
        }
        return true;
    }
}
class Reporter extends Sumo\Singleton
{
}
abstract class Listener extends Sumo\Singleton
{
}
if (defined('LICENSE_KEY')) {
    Settings::set('license_key', LICENSE_KEY);
}