X-Git-Url: https://git.cweiske.de/surrogator.git/blobdiff_plain/c86341304b6e4b6a74f8cc5f80f20504811c486a..fc412baac7378a01d9c5ab90405365b56d3abe4b:/surrogator.php?ds=sidebyside diff --git a/surrogator.php b/surrogator.php index 393b0a2..fdbd384 100755 --- a/surrogator.php +++ b/surrogator.php @@ -11,7 +11,7 @@ * @package Surrogator * @author Christian Weiske * @license http://www.gnu.org/licenses/agpl.html AGPLv3 or later - * @link http://git.cweiske.de/?p=surrogator.git + * @link https://sourceforge.net/p/surrogator/ */ namespace surrogator; $cfgFile = __DIR__ . '/data/surrogator.config.php'; @@ -115,6 +115,18 @@ foreach ($sizes as $size) { mkdir($varDir . '/' . $size, 0755); } } +foreach (array('mm.png', 'default.png') as $resFile) { + if (!file_exists($rawDir . '/' . $resFile)) { + log($resFile . ' missing, copying it from res/', 2); + copy($resDir . '/' . $resFile, $rawDir . '/' . $resFile); + } +} +foreach (array('index.html', 'robots.txt', 'favicon.ico') as $resFile) { + if (!file_exists($wwwDir . '/' . $resFile) && is_writable($wwwDir)) { + log('no www/' . $resFile . ' found, copying default over', 1); + copy($resDir . '/www/' . $resFile, $wwwDir . '/' . $resFile); + } +} if (count($files)) { $fileInfos = array(); @@ -146,6 +158,8 @@ foreach ($fileInfos as $fileInfo) { if ($fileName == 'default.png') { $md5 = $sha256 = 'default'; + } else if ($fileName == 'mm.png') { + $md5 = $sha256 = 'mm'; } else { list($md5, $sha256) = getHashes($fileName); }