diff options
Diffstat (limited to 'examples/server/index.php')
-rw-r--r-- | examples/server/index.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/server/index.php b/examples/server/index.php index a4a2c67..828598a 100644 --- a/examples/server/index.php +++ b/examples/server/index.php @@ -1,13 +1,16 @@ <?php -require_once("example-server.php"); +require_once __DIR__ . '/../../vendor/autoload.php'; +session_save_path('/tmp/SSO1'); // Execute controller command if (realpath($_SERVER["SCRIPT_FILENAME"]) == realpath(__FILE__) && isset($_REQUEST['command'])) { - error_log('executing: '. $_REQUEST['command']); - $sso = new ExampleServer(); - $sso->$_GET['command'](); + $sso = new Jasny\SSO\TestServer(); + $sso->$_REQUEST['command'](); } else { - error_log('nothing to execute'); + error_log('Unkown command'); + header("HTTP/1.1 406 Not Acceptable"); + header('Content-type: application/json; charset=UTF-8'); + + echo "{error: 'Uknown command'}"; } -?>
\ No newline at end of file |