openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

index.php (728B)


      1 <?php
      2 // Excecuting the CMS HTTP Endpoint
      3 // This is both for UI and API requests.
      4 
      5 
      6 require('modules/autoload.php'); // Autoloading all classes
      7 
      8 use cms\base\Startup;
      9 use cms\output\OutputFactory;
     10 
     11 try {
     12 	// Starting the application
     13 	// - Validating the environment
     14 	// - Initialize all constants
     15 	Startup::initialize();
     16 
     17 } catch (ErrorException $e) {
     18 	// Switching to text/plain here because so there is no way to inject any HTML to the page.
     19 	header('Content-Type: text/plain');
     20 	error_log( $e->getMessage() );
     21 	echo "Sorry, startup failed";
     22 	exit;
     23 }
     24 
     25 // Creates the output driver
     26 // Dependent on which data format is requested by the client.
     27 $output = OutputFactory::createOutput();
     28 
     29 $output->execute(); // Outputs the data.