0
1
Fork 0
hedera-web-mindshore/web/html.php

40 lines
753 B
PHP
Raw Normal View History

2017-03-02 10:01:29 +00:00
<?php
function getUrl ($fileName)
{
if (file_exists ($fileName))
{
$hashes = apc_fetch ("$appName.hashes", $success);
if (!$success)
{
apc_store ("$appName.version", $version);
$hashes = [];
}
if (!isset ($hashes[$fileName]))
{
$hash = md5_file($fileName);
$hashes[$fileName] = $hash;
}
else
$hash = $hashes[$fileName];
$mTime = "?$hash";
}
else
$mTime = '';
return $fileName.$mTime;
}
function js ($fileName)
{
return '<script type="text/javascript" src="'. getUrl ($fileName) .'"></script>'."\n";
}
function css ($fileName)
{
return '<link rel="stylesheet" type="text/css" href="'. getUrl ($fileName) .'"/>'."\n";
}