copy index.surrogator.html to index.html if it does not exist
authorChristian Weiske <cweiske@cweiske.de>
Fri, 17 Aug 2012 18:18:30 +0000 (20:18 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 17 Aug 2012 18:18:30 +0000 (20:18 +0200)
data/surrogator.config.php.dist
surrogator.php

index 87efce0970d192e4f3a298a8212b17f1462702bb..947a96a6a801d5bfd7854f7cdcc2b957058f13de 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 $rawDir = __DIR__ . '/../raw/';
 $varDir = __DIR__ . '/../var/';
 <?php
 $rawDir = __DIR__ . '/../raw/';
 $varDir = __DIR__ . '/../var/';
+$wwwDir = __DIR__ . '/../www/';
 $sizes   = array(16, 32, 48, 64, 80, 96, 128, 256, 512);
 $maxSize = 512;
 $logLevel = 1;//0 - nothing, 3 - high
 $sizes   = array(16, 32, 48, 64, 80, 96, 128, 256, 512);
 $maxSize = 512;
 $logLevel = 1;//0 - nothing, 3 - high
index 6519f5b7a67c694a4a7f6bacd49cc5dd8303af56..c7c9d5491d70ba4d5781f24518b06206950a955a 100755 (executable)
@@ -122,6 +122,11 @@ foreach (array('mm.png', 'default.png') as $resFile) {
     }
 }
 
     }
 }
 
+if (!file_exists($wwwDir . '/index.html') && is_writable($wwwDir)) {
+    log('no index.html found, copying default over', 1);
+    copy($wwwDir . '/index.surrogator.html', $wwwDir . '/index.html');
+}
+
 if (count($files)) {
     $fileInfos = array();
     foreach ($files as $file) {
 if (count($files)) {
     $fileInfos = array();
     foreach ($files as $file) {