/** * Constructor * @param HttpRequest $pReq request * @param HttpRequest $pRootResource root resource * @param HttpRequest $pRealm name of the application */ public function __construct(RESTHttpRequest $pReq, $pRootResource, $pRealm) { $this->request = $pReq; // we compute the list of resources classes $this->listResources = ServiceEnumerator::listDefinedResources(); $this->realm = $pRealm; $this->rootResource = $pRootResource; }
/** * list of services * GET / * or HEAD / * @param boolean $pHead true if we return only headers */ public function index($pHead = false) { if ($pHead) { return; } echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; echo '<html><head><title>List of services</title></head><body><ul>'; foreach (ServiceEnumerator::listDefinedResources() as $i) { echo '<li><a href="./' . $i . '/">' . $i . '</a></li>'; } echo '</ul></body></html>'; }