Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
572 bytes
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | // load Tonic library |
---|
4 | require_once '../lib/tonic.php'; |
---|
5 | |
---|
6 | // load examples |
---|
7 | require_once '../examples/examples.php'; |
---|
8 | |
---|
9 | // handle request |
---|
10 | $request = new Request(); |
---|
11 | try { |
---|
12 | $resource = $request->loadResource(); |
---|
13 | $response = $resource->exec($request); |
---|
14 | |
---|
15 | } catch (ResponseException $e) { |
---|
16 | switch ($e->getCode()) { |
---|
17 | case Response::UNAUTHORIZED: |
---|
18 | $response = $e->response($request); |
---|
19 | $response->addHeader('WWW-Authenticate', 'Basic realm="Tonic"'); |
---|
20 | break; |
---|
21 | default: |
---|
22 | $response = $e->response($request); |
---|
23 | } |
---|
24 | } |
---|
25 | $response->output(); |
---|
26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.