initial commit

This commit is contained in:
XlXi 2020-12-13 23:40:57 -05:00
commit 838ffe847b
3 changed files with 81 additions and 0 deletions

35
WebAssemblies/Web.php Normal file
View File

@ -0,0 +1,35 @@
<?php
/*
Platinus Web
*/
namespace Platinus;
class Web {
function __construct() {
ob_start();
}
function GetDomain() {
$serverHost = $_SERVER['HTTP_HOST'];
preg_match("/[^\.\/]+\.[^\.\/]+$/", $serverHost, $regexMatch);
return $regexMatch[0];
}
public function buildHeaders() {
$contents = ob_get_contents();
ob_end_clean();
return $contents;
}
public function buildPage($headers) {
$contents = ob_get_contents();
ob_end_clean();
echo "<!DOCTYPE html>\n<html>\n<head>\n<link rel=\"stylesheet\" href=\"//cdn." . Web::GetDomain() . "/CSS/Base/fetch/\">\n$headers</head>\n<body>\n$contents</body>\n</html>";
}
}
?>

18
WebAssemblies/loader.php Normal file
View File

@ -0,0 +1,18 @@
<?php
/*
Platinus Backend Autoloader
*/
$webAssemblies = $_SERVER["DOCUMENT_ROOT"] . "/../WebAssemblies/";
function reqMod($mod) {
global $webAssemblies;
require $webAssemblies . $mod;
}
reqMod("Web.php");
?>

28
root/index.php Normal file
View File

@ -0,0 +1,28 @@
<?php
/*
Platinus Home Page
*/
require $_SERVER["DOCUMENT_ROOT"] . "/../WebAssemblies/loader.php";
use Platinus\Web;
$page = new Web();
?>
<!--custom headers-->
<?php
$headers = $page->buildHeaders();
?>
<h1>Platinus</h1>
<h3>Yeah</h3>
<?php
$page->buildPage($headers);
?>