mirror of
https://github.com/kvazar-network/webapp.git
synced 2025-01-24 13:54:20 +00:00
add image cache support
This commit is contained in:
parent
4fe592b36c
commit
e0245efaf1
0
cache/index.html
vendored
Normal file
0
cache/index.html
vendored
Normal file
@ -4,8 +4,16 @@ require_once('../library/icon.php');
|
||||
|
||||
if (isset($_GET['hash'])) {
|
||||
|
||||
$icon = new Icon();
|
||||
|
||||
header("Content-Type: image/jpeg");
|
||||
echo $icon->generateImageResource(md5($_GET['hash']), 60, 60, false);
|
||||
|
||||
$filename = dirname(__FILE__) . '/../cache/' . $_GET['hash'] . '.jpeg';
|
||||
|
||||
if (!file_exists($filename)) {
|
||||
|
||||
$icon = new Icon();
|
||||
|
||||
file_put_contents($filename, $icon->generateImageResource(md5($_GET['hash']), 60, 60, false));
|
||||
}
|
||||
|
||||
echo file_get_contents($filename);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user