-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
32 lines (25 loc) · 998 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
<?php
// Excecuting the CMS HTTP Endpoint
// This is both for UI and API requests.
require('modules/autoload.php'); // Autoloading all classes
use cms\base\Startup;
use cms\output\OutputFactory;
try {
// Starting the application
// - Validating the environment
// - Initialize all constants
Startup::initialize();
} catch (ErrorException $e) {
// Switching to text/plain here because so there is no way to inject any HTML to the page.
header('Content-Type: text/plain');
error_log( $e->getMessage() );
echo "Sorry, startup failed\n";
echo $e->getMessage();
exit;
}
// Creates the output driver
// Dependent on which data format is requested by the client.
$output = OutputFactory::createOutput();
$output->execute(); // Outputs the data.
// Notification if this file is called without a running interpreter:
// <h1>Error</h1><b>If this text is visible, your script execution is disabled. Please contact your system administrator.</b> <a href="http://www.openrat.de">OpenRat CMS</a>