<?php
require_once "../lib/config.php";

class reads extends System {
    
    private static $instance;
    
    public function __construct(){
        parent::__construct();
        $this->viewFile();
    }
    
    private function viewFile(){
        $filekey = $this->getDataGet("f");
        
        if(!AWSMangos3Bucket::getInstance()->viewFile($filekey)){
            http_response_code(404);
            
            echo "404 Not Found";
        }
    }
    
    public static function render(){
        if(is_null(self::$instance)){
            self::$instance = new reads();
        }
    }
}

reads::render();