do not generate double headers
[surrogator.git] / surrogator.php
index 8d387d59701c0a071d403305b256da38ad035bb8..fdbd38412aa983e06eb9aee4453793b438a18808 100755 (executable)
@@ -11,7 +11,7 @@
  * @package  Surrogator
  * @author   Christian Weiske <cweiske@cweiske.de>
  * @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';
@@ -118,7 +118,13 @@ foreach ($sizes as $size) {
 foreach (array('mm.png', 'default.png') as $resFile) {
     if (!file_exists($rawDir . '/' . $resFile)) {
         log($resFile . ' missing, copying it from res/', 2);
-        copy(__DIR__ . '/res/' . $resFile, $rawDir . '/' . $resFile);
+        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);
     }
 }