forked from jquery/testswarm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
36 lines (30 loc) · 805 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* This is the main front-end entry point for TestSwarm.
*
* All HTML-based views served to web browsers start here.
* The recommended configuration will have web requests
* rewritten from a path to a query string calling index.php
*
* @author Timo Tijhof, 2012
* @since 0.1.0
* @package TestSwarm
*/
// Valid entry point
define( 'SWARM_ENTRY', 'INDEX' );
require_once __DIR__ . '/inc/init.php';
session_start();
$pageObj = $swarmContext->getRequest()->getPageInstance();
if ( $pageObj instanceof Page ) {
try {
$pageObj->output();
} catch ( Exception $e ) {
$pageObj = Error500Page::newFromContext( $swarmContext );
$pageObj->setExceptionObj( $e );
$pageObj->output();
}
} else {
$pageObj = Error404Page::newFromContext( $swarmContext );
$pageObj->output();
}
exit;