Implement base env detection + simple templating
This commit is contained in:
parent
e6bf477386
commit
adda2114e5
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
$env = 'prod';
|
||||
if (getenv('ENV') !== false && in_array(getenv('ENV'), ['prod', 'dev']))
|
||||
$env = getenv('ENV');
|
||||
define('ENV', $env);
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
if (isset($_SERVER['HTTP_USER_AGENT'])) die;
|
|
@ -0,0 +1,2 @@
|
|||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title><?php echo isset($p['title']) ? $p['title'] : '' ?></title>
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" type="text/css" href="/css/normalize.css?v=1">
|
||||
<link rel="stylesheet" type="text/css" href="/css/skeleton.css?v=1">
|
||||
<?php if (ENV === 'prod'): ?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/custom.css?v=1">
|
||||
<?php endif ?>
|
||||
</head>
|
||||
<body>
|
||||
<?php if (ENV === 'dev'): ?>
|
||||
<style>
|
||||
<?php echo file_get_contents('/var/www/html/css/custom.css') ?>
|
||||
</style>
|
||||
<?php endif ?>
|
Loading…
Reference in New Issue