本文整理汇总了PHP中FileReader::getEvent方法的典型用法代码示例。如果您正苦于以下问题:PHP FileReader::getEvent方法的具体用法?PHP FileReader::getEvent怎么用?PHP FileReader::getEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::getEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
require_once './eagle/utils/Downloader.php';
require_once './eagle/utils/FileReader.php';
require_once './eagle/utils/Utils.php';
require_once './eagle/models/PitScouting.php';
require_once './eagle/models/Defense.php';
require_once './eagle/models/MatchScouting.php';
require_once './eagle/models/Comment.php';
$app->group('/scouting', function () use($app) {
$this->get('/{url:.*\\/}', function ($req, $res, $args) {
header('Location:/event/' . trim($args['url'], '/'));
exit;
});
$this->get('/pit', function ($req, $res, $args) {
Auth::getLoggedInUser();
$event = Utils::getCurrentEvent();
$this->view->render($res, 'pitScoutingHome.html', ['title' => 'Pit Scouting Home', 'teams' => Utils::getUnscoutedTeams($event), 'event' => FileReader::getEvent($event), 'user' => Auth::getLoggedInUser()]);
});
$this->get('/pit/new/{team:[0-9]{1,4}}', function ($req, $res, $args) {
Auth::getLoggedInUser();
$this->view->render($res, 'pitScouting.html', ['title' => 'Pit Scouting for ' . $args['team'], 'team' => $args['team'], 'user' => Auth::getLoggedInUser()]);
});
$this->post('/pit/new', function ($req, $res, $args) {
$defense = new Defense();
$defense->user_id = Auth::getLoggedInUser()->id;
$defense->author = Auth::getLoggedInUser()->name;
$defense->team_id = $_POST['team_id'];
$defense->low_bar = $_POST['lowbar'];
$defense->portcullis = $_POST['portcullis'];
$defense->cheval_de_frise = $_POST['cheval'];
$defense->moat = $_POST['moat'];
$defense->ramparts = $_POST['ramparts'];
示例2: header
}
$rankings = FileReader::getRankingsAtEvent($args['event']);
if (!count($rankings)) {
Downloader::getRankingsAtEvent($args['event']);
header('Refresh:0');
}
$dlstats = FileReader::getStatsAtEvent($args['event']);
if (!$dlstats && !count($dlstats)) {
Downloader::getStatsAtEvent($args['event']);
header('Refresh:0');
}
$stats = array();
for ($i = 0; $i < count((array) $dlstats->oprs); $i++) {
$tempTeam = array_keys((array) $dlstats->oprs)[$i];
$opr = $dlstats->oprs->{$tempTeam};
$dpr = $dlstats->dprs->{$tempTeam};
$ccwm = $dlstats->ccwms->{$tempTeam};
$stats[$tempTeam] = array('number' => $tempTeam, 'opr' => $opr, 'dpr' => $dpr, 'ccwm' => $ccwm);
}
$this->view->render($res, 'event.html', ['title' => $event->name, 'event' => $event, 'teams' => $teams, 'stats' => $stats, 'rankings' => $rankings, 'matches' => $matches, 'user' => Auth::getLoggedInUser()]);
});
$this->get('/{event:\\d{4}[A-Za-z]{1,4}}/update', function ($req, $res, $args) {
Auth::redirectIfNotLoggedIn();
FileReader::getEvent($args['event'], true);
FileReader::getTeamsAtEvent($args['event'], true);
FileReader::getMatchesAtEvent($args['event'], true);
FileReader::getStatsAtEvent($args['event'], true);
FileReader::getRankingsAtEvent($args['event'], true);
return $res->withStatus(302)->withHeader('Location', '/event/' . $args['event']);
});
});