当前位置: 首页>>代码示例>>PHP>>正文


PHP Base_Controller::getVersionDate方法代码示例

本文整理汇总了PHP中Base_Controller::getVersionDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_Controller::getVersionDate方法的具体用法?PHP Base_Controller::getVersionDate怎么用?PHP Base_Controller::getVersionDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Base_Controller的用法示例。


在下文中一共展示了Base_Controller::getVersionDate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_player_certs


//.........这里部分代码省略.........
                 $base_biotech_items = $cached_can_craft['base_biotech_items'];
                 $base_dreadnaught_items = $cached_can_craft['base_dreadnaught_items'];
                 $base_engineer_items = $cached_can_craft['base_engineer_items'];
                 $base_recon_items = $cached_can_craft['base_recon_items'];
                 $base_firecat_items = $cached_can_craft['base_firecat_items'];
                 $base_tigerclaw_items = $cached_can_craft['base_tigerclaw_items'];
                 $base_dragonfly_items = $cached_can_craft['base_dragonfly_items'];
                 $base_recluse_items = $cached_can_craft['base_recluse_items'];
                 $base_rhino_items = $cached_can_craft['base_rhino_items'];
                 $base_mammoth_items = $cached_can_craft['base_mammoth_items'];
                 $base_arsenal_items = $cached_can_craft['base_arsenal_items'];
                 $base_electron_items = $cached_can_craft['base_electron_items'];
                 $base_bastion_items = $cached_can_craft['base_bastion_items'];
                 $base_nighthawk_items = $cached_can_craft['base_nighthawk_items'];
                 $base_raptor_items = $cached_can_craft['base_raptor_items'];
             }
         }
     }
     if ($web_prefs['show_workbench']) {
         //Workbench Stuff
         $workbench_info = array();
         if (Cache::has($player->db_id . '_printer')) {
             $workbench_info = Cache::get($player->db_id . '_printer');
         } else {
             $wbinfo = Printer::where('db_id', '=', $player->db_id)->get();
             foreach ($wbinfo as $wb) {
                 $workbench_info[] = $wb->original;
             }
             Cache::forever($player->db_id . '_printer', $workbench_info);
         }
         if (!empty($workbench_info)) {
             $workbench_info_blueprints = array();
             for ($i = 0; $i < count($workbench_info); $i++) {
                 $workbench_info_blueprints[] = $workbench_info[$i]['blueprint_id'];
             }
             $workbench_results = Recipe::with(array('outputs'))->where_in('itemtypeid', $workbench_info_blueprints)->get(array('itemtypeid', 'description', 'name'));
             $workbench_output_ids = array();
             $workbench_output_names = array();
             //at this point we will always have something in the workbench so don't worry about null
             foreach ($workbench_results as $workbench_result) {
                 if ($workbench_result->relationships['outputs'] != null) {
                     //add the output itemtypeid to the list
                     print_r($workbench_result->relationships['outputs']);
                 } else {
                     //add the blueprint_id as an itemtypeid because its a cert
                     $workbench_output_ids[] = $workbench_result->attributes['itemtypeid'];
                     if (strstr($workbench_result->attributes['description'], "Research")) {
                         $workbench_output_names[$workbench_result->attributes['itemtypeid']] = $workbench_result->attributes['description'];
                     } else {
                         $workbench_output_names[$workbench_result->attributes['itemtypeid']] = $workbench_result->attributes['name'];
                     }
                 }
             }
             unset($workbench_results);
             //get the icons
             $wb_icons = hWebIcon::where(function ($query) use($workbench_output_ids) {
                 $query->where('version', '=', Base_Controller::getVersionDate());
                 $query->where_in('itemTypeId', $workbench_output_ids);
             })->get(array('itemtypeid', 'asset_path'));
             foreach ($wb_icons as $wb) {
                 $workbench_output_icons[$wb->itemtypeid] = $wb->asset_path;
             }
             unset($wb_icons);
         }
     }
     //ShipIt(TM)
     $response = View::make('player.player_profile_store')->with('title', 'Player Store for ' . $playerName)->with(compact('web_prefs'))->with(compact('player'))->with(compact('army'));
     if (!empty($progress)) {
         $response->progress = $progress;
         $response->base_shared_items = $base_shared_items;
         $response->base_assault_items = $base_assault_items;
         $response->base_biotech_items = $base_biotech_items;
         $response->base_dreadnaught_items = $base_dreadnaught_items;
         $response->base_engineer_items = $base_engineer_items;
         $response->base_recon_items = $base_recon_items;
         $response->base_firecat_items = $base_firecat_items;
         $response->base_tigerclaw_items = $base_tigerclaw_items;
         $response->base_dragonfly_items = $base_dragonfly_items;
         $response->base_recluse_items = $base_recluse_items;
         $response->base_rhino_items = $base_rhino_items;
         $response->base_mammoth_items = $base_mammoth_items;
         $response->base_arsenal_items = $base_arsenal_items;
         $response->base_electron_items = $base_electron_items;
         $response->base_bastion_items = $base_bastion_items;
         $response->base_nighthawk_items = $base_nighthawk_items;
         $response->base_raptor_items = $base_raptor_items;
     }
     if (!empty($market_listings)) {
         $response->market_listings = $market_listings;
         if (!empty($item_stats_lookup)) {
             $response->stats = $item_stats_lookup;
         }
     }
     if (!empty($workbench_info)) {
         $response->workbench_info = $workbench_info;
         $response->workbench_output_icons = $workbench_output_icons;
         $response->workbench_output_names = $workbench_output_names;
     }
     return $response;
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:player_stores.php

示例2: Get_Player_Workbench

 public function Get_Player_Workbench($db_id)
 {
     $web_prefs = PlayerAPIController::Get_Player_Webprefs($db_id);
     if ($web_prefs['show_workbench'] != 1) {
         return Response::json(array('status' => 'error', 'error' => 'Player is not allowing workbench viewing.'));
     } else {
         //Workbench Stuff
         $workbench_info = array();
         if (Cache::has($this->class_name . "_" . $db_id . "_Workbench")) {
             $workbench_info = Cache::get($this->class_name . "_" . $db_id . "_Workbench");
         } else {
             $wbinfo = Printer::where('db_id', '=', $player->db_id)->get();
             foreach ($wbinfo as $wb) {
                 $workbench_info[] = $wb->original;
             }
             Cache::forever($this->class_name . "_" . $db_id . "_Workbench", $workbench_info);
         }
         if (!empty($workbench_info)) {
             $workbench_info_blueprints = array();
             for ($i = 0; $i < count($workbench_info); $i++) {
                 //assume Medium health pack for large health packs, this is temporary till we can figure out whats going on with itemtypeid 85374
                 if ($workbench_info[$i]['blueprint_id'] == 85374) {
                     $workbench_info[$i]['blueprint_id'] = 75096;
                 }
                 $workbench_info_blueprints[] = $workbench_info[$i]['blueprint_id'];
             }
             $workbench_results = Recipe::with(array('outputs'))->where_in('itemtypeid', $workbench_info_blueprints)->get(array('itemtypeid', 'description', 'name'));
             $workbench_output_ids = array();
             $workbench_output_names = array();
             //at this point we will always have something in the workbench so don't worry about null
             foreach ($workbench_results as $workbench_result) {
                 if ($workbench_result->relationships['outputs'] != null) {
                     //add the output itemtypeid to the list
                     print_r($workbench_result->relationships['outputs']);
                 } else {
                     //add the blueprint_id as an itemtypeid because its a cert
                     $workbench_output_ids[] = $workbench_result->attributes['itemtypeid'];
                     if (strstr($workbench_result->attributes['description'], "Research")) {
                         $workbench_output_names[$workbench_result->attributes['itemtypeid']] = $workbench_result->attributes['description'];
                     } else {
                         $workbench_output_names[$workbench_result->attributes['itemtypeid']] = $workbench_result->attributes['name'];
                     }
                 }
             }
             unset($workbench_results);
             //get the icons
             $wb_icons = hWebIcon::where(function ($query) use($workbench_output_ids) {
                 $query->where('version', '=', Base_Controller::getVersionDate());
                 $query->where_in('itemTypeId', $workbench_output_ids);
             })->get(array('itemtypeid', 'asset_path'));
             foreach ($wb_icons as $wb) {
                 $workbench_output_icons[$wb->itemtypeid] = $wb->asset_path;
             }
             unset($wb_icons);
             //strip info & append info
             for ($i = 0; $i < count($workbench_info); $i++) {
                 unset($workbench_info[$i]['db_id']);
                 if (isset($workbench_info[$i]['id'])) {
                     unset($workbench_info[$i]['id']);
                 }
                 unset($workbench_info[$i]['created_at']);
                 unset($workbench_info[$i]['updated_at']);
                 unset($workbench_info[$i]['blueprint_id']);
                 if (isset($workbench_output_ids[$i])) {
                     $workbench_info[$i]['item'] = $workbench_output_names[$workbench_output_ids[$i]];
                 } else {
                     $workbench_info[$i]['item'] = 'Undefined';
                 }
                 if (isset($workbench_output_icons[$i])) {
                     $workbench_info[$i]['icon'] = $workbench_output_icons[$workbench_results->attributes['itemtypeid']];
                 } else {
                     $workbench_info[$i]['icon'] = "";
                 }
             }
         }
         $workbench_info['status'] = 'success';
         return json_encode($workbench_info);
     }
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:79,代码来源:PlayerAPIController.php

示例3: get_single_battleframe


//.........这里部分代码省略.........
             if (!empty($player_progresses)) {
                 $check_chassis = unserialize($player_progresses[0]->entry);
             } else {
                 $check_chassis = "";
                 $check_chassis_id = false;
             }
             if (!isset($check_chassis->chassis_id)) {
                 $check_chassis_id = false;
             } else {
                 $check_chassis_id = true;
             }
             if ($player_progresses && $check_chassis_id) {
                 $frame_progress = array();
                 for ($i = 0; $i < count($player_progresses); $i++) {
                     $day_progress = unserialize($player_progresses[$i]->entry);
                     unset($day_progress->unlocks);
                     foreach ($day_progress->xp as $key => $value) {
                         if ($value->sdb_id == 77733 || $value->sdb_id == 82394 || $value->sdb_id == 31334) {
                             //ignore training frame
                         } else {
                             $frame_progress[$value->name][$player_progresses[$i]->updated_at] = $value->lifetime_xp;
                         }
                     }
                 }
                 //Make it json datas
                 $frame_progress_javascript = array();
                 foreach ($frame_progress as $battle_frame_name => $value) {
                     $xp_data_string = "[";
                     foreach ($value as $day => $xp_amt) {
                         $xp_data_string .= "[" . $day * 1000 . "," . $xp_amt . "],";
                         $frame_progress_javascript[$battle_frame_name] = rtrim($xp_data_string, ",") . "]";
                     }
                 }
             } else {
                 $frame_progress_javascript = null;
                 $progress = false;
             }
             //build cache
             Cache::put($player_progresses_cache_key, $frame_progress_javascript, 30);
         }
     } else {
         $frame_progress_javascript = null;
         $progress = false;
     }
     //Frames & Unlocks
     if ($progress) {
         $progress = unserialize($progress->entry);
         $cache_key_progress = $player->db_id . "_progress";
         if (Cache::Get($cache_key_progress) != $progress) {
             if (isset($progress->xp)) {
                 $battle_frame_id_list = array();
                 for ($i = 0; $i < count($progress->xp); $i++) {
                     $battle_frame_id_list[$i] = $progress->xp[$i]->sdb_id;
                 }
                 $battle_frame_images = hWebIcon::where(function ($query) use($battle_frame_id_list) {
                     $query->where('version', '=', Base_Controller::getVersionDate());
                     $query->where_in('itemTypeId', $battle_frame_id_list);
                 })->get();
                 //set some cache
                 Cache::forever($cache_key_progress . "_battleframe_images", $battle_frame_images);
             } else {
                 $battle_frame_images = null;
             }
             if (isset($web_prefs['show_unlocks'])) {
                 $show_unlocks = $web_prefs['show_unlocks'];
             } else {
                 //Assume show unlocks is 1
                 $show_unlocks = 1;
             }
             if (isset($progress->unlocks) && $show_unlocks == 1) {
                 //VERSION 0.6 CHECK (Array = BAD, Object = Good!)
                 if (gettype($progress->unlocks) == "array") {
                     //NOPE.
                     $battle_frame_unlocks = null;
                 } else {
                     if (gettype($progress->unlocks) == "object") {
                         //Looks like 0.7+ to me!
                         //Create a cache for each frame unlock set
                         foreach ($progress->unlocks as $chassis_id => $cert_array) {
                             if ($chassis_id == 77733 || $chassis_id == 82394 || ($chassis_id = 31334)) {
                                 //ignore training frame
                             } else {
                                 Cache::forever($cache_key_progress . "_" . $chassis_id, $cert_array);
                             }
                         }
                     }
                 }
             }
             //Cache the progress variable so we can do a quick compare on a later load
             Cache::forever($cache_key_progress, $progress);
         } else {
             //Assign cache values to local variable names.
             $battle_frame_images = Cache::Get($cache_key_progress . "_battleframe_images");
             $progress = Cache::Get($cache_key_progress);
         }
     } else {
         $battle_frame_unlocks = null;
     }
     return View::make('player.single_battleframe')->with('title', 'Player Profile for ' . $playerName)->with(compact('player'))->with(compact('frame_name'))->with(compact('loadout'))->with(compact('battle_frame_unlocks'))->with(compact('progress'))->with(compact('frame_progress_javascript'))->with(compact('battle_frame_images'))->with(compact('web_prefs'));
 }
开发者ID:odie5533,项目名称:ThumpDumpDB,代码行数:101,代码来源:player_data.php


注:本文中的Base_Controller::getVersionDate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。