コード例 #1
0
 public function index($characterId)
 {
     if (is_numeric($characterId)) {
         $dataApi = new EQ2DataApi();
         $generator = new UrlGenerator($dataApi);
         $url = $generator->GenerateForPlayerId($characterId);
         if ($url != null) {
             $this->writeJsonResponse($url);
             return;
         }
     }
     throw new RestException(400);
 }
コード例 #2
0
ファイル: index.php プロジェクト: bstewart00/eq2aa
<?php

require_once "../api/EQ2DataApi.php";
require_once "../api/UrlGenerator.php";
if ($_GET) {
    $characterId = $_GET['id'];
    if (is_numeric($characterId)) {
        $dataApi = new EQ2DataApi();
        $generator = new UrlGenerator($dataApi);
        $url = $generator->GenerateForPlayerId($characterId);
        if ($url != null) {
            header("Location: {$url}");
        }
    }
    echo "Invalid character ID";
}