Example #1
0
function LoadGachaBase()
{
    echo 'LoadGachaBase<br>';
    $jsonData = LoadJsonFile("GachaBase.txt");
    $TotalGachaBaseRate = 0;
    DeleteData("GachaBase");
    foreach ($jsonData as $key => $value) {
        $TotalGachaBaseRate = $TotalGachaBaseRate + $value['RATE'];
        InsertRedis_Hash("GachaBase", $value['ID'], $TotalGachaBaseRate);
    }
    DeleteData("TotalGachaBaseRate");
    InsertRedis("TotalGachaBaseRate", $TotalGachaBaseRate);
}
 public function Create()
 {
     $postdata = json_decode($this->input->raw_input_stream);
     $email = $postdata->Email;
     $password = $postdata->Password;
     $role = $postdata->Role;
     $key = $postdata->RegisterKey;
     if ($key === LoadJsonFile(APPPATH . 'app_data/key.gen.json')->registerkey) {
         $result = $this->Member->Create($email, $password, $role);
         $this->response->Json(array('Success' => $result));
     } else {
         $this->response->Json(array('Success' => false, 'Error' => 'the register is error!'));
     }
 }
Example #3
0
 private function Initialize()
 {
     if ($this->caches->Get('gulp_config') && $this->caches->Get('bundle_setting')) {
         $this->Config = $this->caches->Get('gulp_config');
         $this->Setting = $this->caches->Get('bundle_setting');
         $this->Key = $this->caches->Get('key');
     } else {
         $config = LoadJsonFile(APPPATH . 'app_data/gulp.config.json')->config;
         $setting = LoadJsonFile(APPPATH . 'app_data/bundle.setting.json')->setting;
         $key = LoadJsonFile(APPPATH . 'app_data/bundle.setting.json')->key;
         $this->caches->Set('gulp_config', $config, 60 * 60 * 24 * 7);
         $this->caches->Set('bundle_setting', $setting, 60 * 60 * 24 * 7);
         $this->caches->Set('key', $key, 60 * 60 * 24 * 7);
         $this->Config = $config;
         $this->Setting = $setting;
         $this->Key = $key;
     }
 }