initial commit
This commit is contained in:
commit
838ffe847b
|
|
@ -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>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|
||||
Platinus Backend Autoloader
|
||||
|
||||
*/
|
||||
|
||||
$webAssemblies = $_SERVER["DOCUMENT_ROOT"] . "/../WebAssemblies/";
|
||||
|
||||
function reqMod($mod) {
|
||||
global $webAssemblies;
|
||||
require $webAssemblies . $mod;
|
||||
}
|
||||
|
||||
reqMod("Web.php");
|
||||
|
||||
?>
|
||||
|
|
@ -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);
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue