X-Git-Url: https://git.cweiske.de/surrogator.git/blobdiff_plain/059125f7cff9d99a67733cd29e6f13c4ab222263..fc412baac7378a01d9c5ab90405365b56d3abe4b:/surrogator.php diff --git a/surrogator.php b/surrogator.php index dd907e0..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,9 +115,17 @@ foreach ($sizes as $size) { mkdir($varDir . '/' . $size, 0755); } } -if (!file_exists($rawDir . '/mm.png')) { - log('mm.png missing, copying it from res/', 2); - copy(__DIR__ . '/res/mm.png', $rawDir . '/mm.png'); +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)) {