public function actionIndex($date = null) { if (!$date) { $versions = KFile::getVersions(); $date = $versions[count($versions) - 1]; } Yii::app()->params['activeVersion'] = $date; if (!file_exists('data/master/' . $date . '/changes.json')) { $this->viewUnprocessed($date); } else { $this->viewExisting($date); } }
public static function scanShip($date) { foreach (array_reverse(KFile::getVersions()) as $version) { if ($date != $version) { $current = $version; break; } } $allShip = KFile::readJSON('data/master/' . $date . '/ship/_raw.json'); $remodelPointers = array(); foreach ($allShip as $oneShip) { $remodelPointers[@$oneShip->api_aftershipid] = true; } $_fresh = array(); $_remodel = array(); $_updated = array(); $_abyss = array(); $records = glob('data/master/' . $date . '/ship/*'); foreach ($records as $recordFile) { $jsonFile = array_pop(explode('/', $recordFile)); if (!in_array($jsonFile, array('_raw.json', '_summary.json', '_classes.json'))) { $oldCounterpart = 'data/master/' . $current . '/ship/' . $jsonFile; if (file_exists($oldCounterpart)) { if (md5_file($recordFile) != md5_file($oldCounterpart)) { $newContents = KFile::readJSON($recordFile); $oldContents = KFile::readJSON($oldCounterpart); $_updated[] = self::compareRecords($newContents, $oldContents); } } else { $thisData = KFile::readJSON($recordFile); if (isset($remodelPointers[$thisData->api_id])) { $_remodel[] = $thisData; } else { if (@$thisData->api_buildtime > 0) { $_fresh[] = $thisData; } else { $_abyss[] = $thisData; } } } } } return array('ship' => array('fresh' => $_fresh, 'remodel' => $_remodel, 'updated' => $_updated, 'abyss' => $_abyss)); }
<?php if (!file_exists('data/master/' . date("Y-m-d_H-i") . '/raw.json') && isset($_REQUEST['SHOWDL'])) { ?> <a href="<?php echo Yii::app()->createUrl('decodes/add/download'); ?> "> <div class="master master_add"><div>+ Add new version</div></div></a> <div class="master_separator"></div> <?php } ?> <?php foreach (array_reverse(KFile::getVersions()) as $master) { ?> <a href="<?php echo Yii::app()->createUrl('decodes/view/index', array('date' => $master)); ?> "> <div class="master master_ver<?php if (Yii::app()->params['activeVersion'] == $master) { echo ' master_active'; } ?> "><div> <?php echo $master; ?> </div></div></a>
public function actionVoicecheck() { $this->layout = 'listing'; Yii::app()->clientScript->registerCssFile($this->module->getAssetsUrl() . '/css/listing.css'); $versions = KFile::getVersions(); $mdate = $versions[count($versions) - 1]; $allGraphs = KFile::readJSON('data/master/' . $mdate . '/shipgraph/_raw.json'); $graphIndexed = array(); foreach ($allGraphs as $allGraph) { $graphIndexed[$allGraph->api_id] = $allGraph->api_filename; } if (isset($_REQUEST['checkdate'])) { $checkdate = $_REQUEST['checkdate']; } else { $tz = new DateTimeZone('Asia/Tokyo'); $date = new DateTime(); $date->setTimezone($tz); $checkdate = $date->format('Y-m-d'); } if (file_exists('data/voices/dates/' . $checkdate . '.json')) { $changes = KFile::readJSON('data/voices/dates/' . $checkdate . '.json'); } else { $changes = array(); } $this->render('decodes.views.extra.VoiceCheck', array('date' => $mdate, 'ships' => KFile::readJSON('data/master/' . $mdate . '/ship/_summary.json'), 'graphs' => $graphIndexed, 'checkdate' => $checkdate, 'changes' => $changes)); }
public function actionShips() { $versions = KFile::getVersions(); $date = $versions[count($versions) - 1]; $ships = KFile::readJSON('data/master/' . $date . '/ship/_summary.json'); foreach ($ships as $ship) { // if($ship->isBase && $ship->build>0){ if ($ship->build > 0) { $shipData = KFile::readJSON('data/master/' . $date . '/ship/' . $ship->id . '.json'); // print_r($shipData); // if($ship->rarity<4 && $ship->stype==2){ // echo '('.$ship->id.', "'.$ship->english.'",'.$ship->stype.'),<br />'; // echo '"'.strtolower($ship->english).'":'.$ship->id.',<br />'; // echo '('.$ship->id.', "'.$ship->english.'", '.$ship->stype.', '.$shipData->api_afterlv.', '.$shipData->api_aftershipid.'),<br />';//.' '.$ship->english.'<br />'; echo $ship->english . '<br />'; // } } // } } }