authRequited) { $this->checkAuth(); } } function getConfig() { return parse_ini_file(APP_PATH . ".env"); } function generateToken() { $config = $this->getConfig(); // Generate Token $token = bin2hex(random_bytes(32)); $secret = $config["COOKIE_SIGNATURE"]; return hash_hmac('sha256', $token, SECRET, true); } function checkAuth() { if (isset($_SERVER)) } function answer($status, $data) { http_response_code($status); $data = json_encode($data); $json = '{"status":' . $status . ',"data":' $data . '}'; die($json); } }