Skip to content

Commit

Permalink
Removed branding and documentation
Browse files Browse the repository at this point in the history
- These modules have moved to git repos tina4stack/branding and tina4stack/documentation respectively.
Added code for local caching
  • Loading branch information
andrevanzuydam committed Sep 18, 2023
1 parent 3b07896 commit 88a0c38
Show file tree
Hide file tree
Showing 164 changed files with 7 additions and 54,069 deletions.
5 changes: 3 additions & 2 deletions Tina4/Routing/ParseTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ final public function parseFile(string $fileName)
else {
Debug::message("$this->GUID Found ".$realFileName, TINA4_LOG_DEBUG);
$this->headers[] = "Content-Type: " . $mimeType;
$this->headers[] = ('Cache-Control: max-age=' . (60 * 60) . ', public');
$this->headers[] = ('Cache-Control: max-age=' . (60 * 60 * 60) . ', public');
$this->headers[] = "Tina4-Debug: ".$this->GUID;
$this->headers[] = ('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60))); //1 hour expiry time
$this->headers[] = ('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 60))); //60 hour expiry time
$this->headers[] = ('Pragma: cache');
$this->fileName = $realFileName;
if (!is_dir($realFileName)) {
$content = file_get_contents($realFileName);
Expand Down
6 changes: 4 additions & 2 deletions Tina4/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,10 @@ public function returnStatic($fileName)

$headers[] = ('Content-Type: ' . $mimeType);
$headers[] = ('Tina4-Debug: '.$this->GUID);
$headers[] = ('Cache-Control: max-age=' . (60 * 60) . ', public');
$headers[] = ('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60))); //1 hour expiry time
$headers[] = ('Cache-Control: max-age=' . (60 * 60 * 60) . ', public');
$headers[] = ('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + (60 * 60 * 60))); //60 hour expiry time
$headers[] = ('Pragma: cache');


$ext = pathinfo($fileName, PATHINFO_EXTENSION);
if ($ext !== "twig") {
Expand Down
11 changes: 0 additions & 11 deletions Tina4/Twig/TwigUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ public static function initTwig(?Config $config = null): Environment
$twig->addFunction($dumpFunction);
}

$includeCode = new TwigFunction("include_code", function($fileName) {
$fileName = "./src/templates/documentation/".$fileName;
if (file_exists($fileName)) {
return file_get_contents($fileName);
}

return "";
});

$twig->addFunction($includeCode);

$twig->addGlobal('Tina4', new Caller());
if (isset($_SERVER["HTTP_HOST"])) {
$twig->addGlobal('url', (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed branding/JPG/Icons/tina4-icon-transparent.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed branding/JPG/Logos/tina4-logo-transparent.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed branding/PNG/Icons/tina4-icon-transparent.png
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Binary file removed branding/PNG/Logos/tina4-logo-transparent.png
Diff not rendered.
1 change: 0 additions & 1 deletion branding/SVG/Badges/tina4-icon-badge-dark-transparent.svg
Diff not rendered.
Diff not rendered.
1 change: 0 additions & 1 deletion branding/SVG/Badges/tina4-icon-badge-teal-transparent.svg
Diff not rendered.
Diff not rendered.
1 change: 0 additions & 1 deletion branding/SVG/Badges/tina4-icon-badge-white-transparent.svg
Diff not rendered.
Loading

0 comments on commit 88a0c38

Please sign in to comment.