Beispiel #1
0
 function process()
 {
     global $config;
     $backend = Backend::createBackend($config['backend']);
     if (substr($this->getPath(), 0, 5) == 'sire/') {
         // Sire internal page
         $code = $this->internal(substr($this->getPath(), 5), $backend);
         $this->handleStatus($code);
         return;
     }
     // Regular request handling
     $file = File::createFile($backend, $this->getPath());
     if ($file instanceof File) {
         $templates = new \League\Plates\Engine('template');
         echo $templates->render('content', ['file' => $file]);
     } else {
         if ($file == 200) {
             // Asset fallback
             $backend->serveRaw($this->getPath());
         } else {
             // Error handling
             $this->handleStatus($file);
         }
     }
 }
Beispiel #2
0
 public function __construct($name, $backend)
 {
     parent::__construct($name, $backend);
 }