parent
7c402571ab
commit
9b495f254f
@ -0,0 +1,39 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
declare(strict_types = 1); |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Robert Strutts <Robert@TryingToScale.com> |
||||||
|
* @copyright Copyright (c) 2022, Robert Strutts. |
||||||
|
* @license https://mit-license.org/ |
||||||
|
*/ |
||||||
|
namespace prj\mockup\controllers\app; |
||||||
|
|
||||||
|
/** |
||||||
|
* Description of cookie_ctrl |
||||||
|
* |
||||||
|
* @author Robert Strutts <Robert@TryingToScale.com> |
||||||
|
*/ |
||||||
|
class cookie_ctrl { |
||||||
|
|
||||||
|
public function __construct() { |
||||||
|
$key = "78a5011b9997cd03a28a3412c66565b7c32715b35e055d7abfc228236308d3b2"; |
||||||
|
$sc = new \tts\services\paragon_crypto\sodium_storage($key); |
||||||
|
|
||||||
|
$handler = new \tts\services\sessions\cookie_sessions($sc); |
||||||
|
session_set_save_handler($handler, true); |
||||||
|
|
||||||
|
session_start(); |
||||||
|
} |
||||||
|
|
||||||
|
public function save() { |
||||||
|
$_SESSION['admin'] = "Bob"; |
||||||
|
$_SESSION['logged_in'] = true; |
||||||
|
} |
||||||
|
|
||||||
|
public function read() { |
||||||
|
var_dump($_SESSION); |
||||||
|
// var_dump($_SESSION['admin'] ?? ""); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,60 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
declare(strict_types=1); |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Robert Strutts <Robert@TryingToScale.com> |
||||||
|
* @copyright Copyright (c) 2022, Robert Strutts. |
||||||
|
* @license https://mit-license.org/ |
||||||
|
*/ |
||||||
|
|
||||||
|
$protocol = "HTTP/1.0"; |
||||||
|
if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] ) { |
||||||
|
$protocol = "HTTP/1.1"; |
||||||
|
} |
||||||
|
|
||||||
|
header( "{$protocol} 404 Not Found", true, 404 ); |
||||||
|
header('Content-type: text/html; charset=utf-8'); |
||||||
|
if (defined("PROJECT_ASSETS_BASE_REF")) { |
||||||
|
$base_ref = PROJECT_ASSETS_BASE_REF; |
||||||
|
} else { |
||||||
|
$base_ref = ""; |
||||||
|
} |
||||||
|
?> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<base href="<?= $base_ref ?>/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<meta name="language" content="english"> |
||||||
|
<meta name="robots" content="no-follow"> |
||||||
|
<link rel="shortcut icon" href="<?= $base_ref ?>/favicon/favicon.ico">
|
||||||
|
<title>404 Page not found!</title> |
||||||
|
<style> |
||||||
|
@media only screen and (max-width: 600px) { |
||||||
|
#nopage { |
||||||
|
height: 150px; |
||||||
|
width: 300px; |
||||||
|
} |
||||||
|
} |
||||||
|
@media only screen and (min-width: 600px) { |
||||||
|
#nopage { |
||||||
|
height: 500px; |
||||||
|
width: 1500px; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
<div id="wrap"> |
||||||
|
<?php
|
||||||
|
$assets = \bs_tts\site_helper::get_asset("images/404page.jpg"); |
||||||
|
?> |
||||||
|
<img src="<?= $assets ?>/images/404page.jpg" alt="Page not found." id="nopage"/>
|
||||||
|
<header><h1>404 Page not found!<h1></header> |
||||||
|
<h3>Our apologies for the temporary inconvenience.</h3> |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
</html> |
||||||
|
<?php |
||||||
|
exit; |
||||||
@ -0,0 +1,31 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
declare(strict_types=1); |
||||||
|
if (defined("PROJECT_ASSETS_BASE_REF")) { |
||||||
|
$base_ref = PROJECT_ASSETS_BASE_REF; |
||||||
|
} else { |
||||||
|
$base_ref = ""; |
||||||
|
} |
||||||
|
?> |
||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<base href="<?= $base_ref ?>/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<meta name="keywords" content=""> |
||||||
|
<meta name="description" content=""> |
||||||
|
<meta name="author" content="Robert Strutts"> |
||||||
|
<meta name="language" content="english"> |
||||||
|
<meta name="robots" content=""> |
||||||
|
<meta name="copyright" content="2014-<?= date('Y'); ?>">
|
||||||
|
<title>DEV ERROR!</title> |
||||||
|
<link rel="shortcut icon" href="<?= $base_ref ?>/favicon/favicon.ico">
|
||||||
|
</head> |
||||||
|
<body id="my-page"> |
||||||
|
<div id="wrap"> |
||||||
|
<div id="autosavemessage"></div> |
||||||
|
<?= $local->page_output; ?> |
||||||
|
</div> <!-- end wrap --> |
||||||
|
</body> |
||||||
|
</html> |
||||||
@ -0,0 +1,48 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
declare(strict_types=1); |
||||||
|
|
||||||
|
/** |
||||||
|
* @author Robert Strutts <Robert@TryingToScale.com> |
||||||
|
* @copyright Copyright (c) 2022, Robert Strutts. |
||||||
|
* @license https://mit-license.org/ |
||||||
|
*/ |
||||||
|
|
||||||
|
define('PRODUCTION', 600); |
||||||
|
define('MAINTENACE', 3600); // 1 hour = 3600 seconds |
||||||
|
define('RETRY_AFTER', PRODUCTION); |
||||||
|
|
||||||
|
if(! headers_sent()) { |
||||||
|
header('HTTP/1.1 503 Service Temporarily Unavailable'); |
||||||
|
header('Status: 503 Service Temporarily Unavailable'); |
||||||
|
header('Retry-After: ' . RETRY_AFTER); |
||||||
|
} |
||||||
|
if (defined("PROJECT_ASSETS_BASE_REF")) { |
||||||
|
$base_ref = PROJECT_ASSETS_BASE_REF; |
||||||
|
} else { |
||||||
|
$base_ref = ""; |
||||||
|
} |
||||||
|
?> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<base href="<?= $base_ref ?>/">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
||||||
|
<meta name="author" content="Robert Strutts"> |
||||||
|
<meta name="language" content="english"> |
||||||
|
<meta name="robots" content="NOINDEX, NOFOLLOW"> |
||||||
|
<meta name="copyright" content="2014-<?php echo date('Y'); ?>">
|
||||||
|
<link rel="shortcut icon" href="<?= $base_ref ?>/favicon/favicon.ico">
|
||||||
|
<title>Sorry, we had an error...</title> |
||||||
|
<style> |
||||||
|
body { padding: 20px; background: #C00; color: white; font-size: 40px; } |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
<body> |
||||||
|
|
||||||
|
<h1>Sorry, we had an error...</h1> |
||||||
|
<p>We apologize for any inconvenience this may cause.<p> |
||||||
|
|
||||||
|
</body> |
||||||
|
</html> |
||||||
|
<?php exit; |
||||||
Loading…
Reference in new issue