viewgit/inc/functions.php:22 Function utf8_encode() is deprecated [8192]

Adds a delay between prcoessing individual pages to prevent CPU overheating, fixes a bug in Wiki Static page display, a=chris

Chris Pollett [2016-10-01 20:Oct:st]
Adds a delay between prcoessing individual pages to prevent CPU overheating, fixes a bug in Wiki Static page display, a=chris
Filename
src/configs/Config.php
src/executables/Fetcher.php
src/views/elements/WikiElement.php
diff --git a/src/configs/Config.php b/src/configs/Config.php
index 3b68300ea..c6bb22477 100755
--- a/src/configs/Config.php
+++ b/src/configs/Config.php
@@ -561,6 +561,11 @@ function defineMemoryProfile()
          */
         nsdefine('MEMORY_PROFILE', MEMORY_STANDARD);
     }
+    /**
+     * Delay in microseconds between processing pages to try to avoid
+     * CPU overheating. On some systems, you can set this to 0.
+     */
+    nsconddefine('FETCHER_PROCESS_DELAY', 10000);
 }

 /**
diff --git a/src/executables/Fetcher.php b/src/executables/Fetcher.php
index c071ac2d7..25bbf7f8e 100755
--- a/src/executables/Fetcher.php
+++ b/src/executables/Fetcher.php
@@ -1772,6 +1772,9 @@ class Fetcher implements CrawlConstants
                 }
                 $doc_info = $processor->handle($site[self::PAGE],
                     $site[self::URL]);
+                if (C\FETCHER_PROCESS_DELAY > 0 ) {
+                    usleep(C\FETCHER_PROCESS_DELAY);
+                }
                 if (isset($site[self::REPOSITORY_TYPE]) &&
                     $site[self::REPOSITORY_TYPE] == self::REPOSITORY_GIT) {
                     $site[self::URL] = $tmp_url_store;
diff --git a/src/views/elements/WikiElement.php b/src/views/elements/WikiElement.php
index 8d8bd5c7e..f7bda910b 100644
--- a/src/views/elements/WikiElement.php
+++ b/src/views/elements/WikiElement.php
@@ -766,15 +766,19 @@ class WikiElement extends Element implements CrawlConstants
             <form>
             <div><b><?=tl('wiki_element_places')?></b><?php
             $sub_path = $this->renderPath('resource-path',
-                $data, [$folder_prefix => ""]); ?>
+                $data, [$folder_prefix => ""]);
+            $arg = ($data['CONTROLLER'] == 'static') ? 'read' : $data['MODE'];
+            $a = ($data['CONTROLLER'] == 'static') ? 'showPage' : 'wiki';
+            $page_name = ($data['CONTROLLER'] == 'static') ? 'p' : 'page_name';
+            ?>
             <b><label for='resource-filter'><?=
             tl('wiki_element_resource_filter')?></label></b>
             <input type="hidden" name='<?=C\CSRF_TOKEN?>'
                 value='<?=$data[C\CSRF_TOKEN]?>' />
-            <input type="hidden" name='arg' value='<?=$data['MODE'] ?>' />
-            <input type="hidden" name='a' value='wiki' />
+            <input type="hidden" name='arg' value='<?=$arg ?>' />
+            <input type="hidden" name='a' value='<?=$a ?>' />
             <input type="hidden" name='c' value='<?=$data['CONTROLLER'] ?>' />
-            <input type="hidden" name='page_name'
+            <input type="hidden" name='<?= $page_name?>'
                 value='<?=$data['PAGE_NAME']?>' />
             <?php
             if (!empty($data['SUB_PATH'])) { ?>
ViewGit