コード例 #1
0
ファイル: checkacc.php プロジェクト: giuliaforsythe/AChecker
// set to default guideline if no input guidelines
if (!is_array($gids)) {
    $gids[] = DEFAULT_GUIDELINE;
}
// retrieve user link ID
$userLinksDAO = new UserLinksDAO();
$user_link_id = $userLinksDAO->getUserLinkID($user_id, $uri, $gids);
// set new session id
$userLinksDAO->setLastSessionID($user_link_id, Utility::getSessionID());
// validating uri content
$validate_content = @file_get_contents($uri);
if (isset($validate_content)) {
    $aValidator = new AccessibilityValidator($validate_content, $gids, $uri);
    $aValidator->setLineOffset($offset);
    $aValidator->validate();
    $errors = $aValidator->getValidationErrorRpt();
    // save errors into user_decisions
    //	$userDecisionsDAO = new UserDecisionsDAO();
    //	$userDecisionsDAO->saveErrors($user_link_id, $errors);
    if ($output == 'html') {
        // generate html output
        $htmlWebServiceOutput = new HTMLWebServiceOutput($aValidator, $user_link_id, $gids);
        echo $htmlWebServiceOutput->getWebServiceOutput();
    }
    if ($output == 'rest') {
        // generate html output
        $restWebServiceOutput = new RESTWebServiceOutput($errors, $user_link_id, $gids);
        header('Content-type: text/xml');
        echo $restWebServiceOutput->getWebServiceOutput();
    }
}