-
-
Save daugaard47/f6fb7a266541a81c308182f95ad5be7c to your computer and use it in GitHub Desktop.
Laragon.org enhanced "homepage"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!empty($_GET['q'])) { | |
switch ($_GET['q']) { | |
case 'info': | |
phpinfo(); | |
exit; | |
break; | |
} | |
} | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Laragon</title> | |
<link href="https://fonts.googleapis.com/css?family=Karla:400" rel="stylesheet" type="text/css"> | |
<style> | |
html, body { | |
height: 100%; | |
} | |
body { | |
margin: 0; | |
padding: 0; | |
width: 100%; | |
display: table; | |
font-weight: 100; | |
font-family: 'Karla'; | |
} | |
.container { | |
text-align: center; | |
display: table-cell; | |
vertical-align: middle; | |
} | |
.content { | |
text-align: center; | |
display: inline-block; | |
} | |
.title { | |
font-size: 96px; | |
} | |
.opt { | |
margin-top: 30px; | |
} | |
.opt a { | |
text-decoration: none; | |
font-size: 150%; | |
} | |
a:hover { | |
color: red; | |
} | |
.sites { | |
display: grid; | |
grid-template-columns: 275px 275px 275px 275px; | |
grid-gap: 24px; | |
} | |
.sites li { | |
display: block; | |
background: #323845; | |
box-shadow: 0 0 10px 0 #ccc; | |
height: 48px; | |
line-height: 48px; | |
width: 275px; | |
text-align: left; | |
transition: box-shadow 250ms ease-in-out; | |
} | |
.sites li:hover { | |
box-shadow: 0 0 15px 0 #bbb; | |
} | |
.sites li:hover svg { | |
fill: #ffffff; | |
} | |
.sites li:hover a { | |
color: #ffffff; | |
} | |
.sites li a { | |
display: block; | |
padding-left: 48px; | |
color: #f2f2f2; | |
transition: color 250ms ease-in-out; | |
} | |
.sites img{ | |
position: absolute; | |
margin: 8px; | |
margin-left: -40px; | |
fill: #f2f2f2; | |
transition: fill 250ms ease-in-out; | |
} | |
.sites svg { | |
position: absolute; | |
margin: 16px; | |
margin-left: -40px; | |
fill: #f2f2f2; | |
transition: fill 250ms ease-in-out; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="content"> | |
<div class="title" title="Laragon">My Dev Sites</div> | |
<div class="info"><br /> | |
<?php print($_SERVER['SERVER_SOFTWARE']); ?><br /> | |
PHP version: <?php print phpversion(); ?> <span><a title="phpinfo()" href="/?q=info">info</a></span><br /> | |
Document Root: <?php print ($_SERVER['DOCUMENT_ROOT']); ?><br /> | |
<?php | |
error_reporting(0); | |
$laraconfig = parse_ini_file('../usr/laragon.ini'); | |
$link = mysqli_connect('localhost', 'root', $laraconfig['MySQLRootPassword']); | |
if(!$link) $link = mysqli_connect('localhost', 'root', 'ADD PASSWORD HERE'); | |
if (!$link) { | |
echo 'MySQL not running!'; | |
} else { | |
printf("MySQL server version: %s\n", mysqli_get_server_info($link)); | |
} | |
?><br /> | |
Running on Laragon Full 4.0.11<br /> | |
</div> | |
<div class="opt"> | |
<?php | |
$folders = array_filter(glob('*'), 'is_dir'); | |
if($laraconfig['SSLEnabled'] == 0 || $laraconfig['Port'] == 80) $url = 'http'; | |
else $url = 'https'; | |
echo '<ul class="sites">'; | |
foreach($folders as $host) { | |
if(file_exists($host.'/favicon.png')) $favicon = '<img src="./'.$host.'/favicon.png" width="32" height="32"/>'; | |
elseif(file_exists($host.'/favicon.ico')) $favicon = '<img src="./'.$host.'/favicon.ico" width="32" height="32"/>'; | |
else $favicon = '<svg width="16px" height="16px" viewBox="0 0 19 19" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><path d="M6.073,1.44l-1.206,1.206l6.853,6.854l-6.853,6.852l1.206,1.207l8.06,-8.059l-8.06,-8.06Z" style="fill-rule:nonzero;"/></svg>'; | |
echo '<li><a href="'. $url .'://'.$host.'.oo">'.$favicon.' '.$host.'</a></li>'; | |
} | |
echo '</ul>'; | |
?> | |
</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment