]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6598 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Dec 2023 13:17:23 +0000 (14:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Dec 2023 13:17:23 +0000 (14:17 +0100)
app/Fluidbook/Farm.php
app/Models/FluidbookDocument.php

index 1701767f831515c3660d23a0e46d9282c2392abf..9451ccf9be8131653eda5d74a91565876d63d9c8 100644 (file)
@@ -19,22 +19,20 @@ class Farm
 
     //protected static $_forceServer = 'alphaville';
 
-    const LOCAL_SERVER = "dracula";
-
     protected static $_region = Region::EUROPE;
 
     protected static $_farmServers = [
-        ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 12, 'region' => Region::EUROPE],
-        ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 6, 'region' => Region::USA],
-        ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE],
-        ['name' => 'dobermann', 'host' => 'dobermann.cubedesigners.com', 'weight' => 6, 'region' => Region::EUROPE],
-        ['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE],
-        ['name' => 'fastandfurious', 'host' => 'fastandfurious.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE],
-        //['name' => 'godzilla', 'host' => 'godzilla.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE],
-        ['name' => 'her', 'host' => 'her2.cubedesigners.com', 'weight' => 4, 'region' => Region::EUROPE],
-        ['name' => 'isleofdogs', 'host' => 'paris.cubedesigners.com', 'port' => 9458, 'weight' => 2, 'region' => Region::EUROPE],
-        ['name' => 'jumanji', 'host' => 'paris.cubedesigners.com', 'port' => 9459, 'weight' => 2, 'region' => Region::EUROPE],
-        ['name' => 'kingkong', 'host' => 'kingkong.cubedesigners.com', 'weight' => 6, 'region' => Region::USA],
+        ['name' => 'alphaville', 'host' => 'fluidbook-processfarm', 'port' => 9000, 'weight' => 12, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'brazil', 'host' => 'brazil.cubedesigners.com', 'weight' => 6, 'region' => Region::USA, 'local' => false],
+        ['name' => 'dracula', 'host' => 'dracula.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE, 'local' => true],
+        ['name' => 'dobermann', 'host' => 'dobermann.cubedesigners.com', 'weight' => 6, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'elephantman', 'host' => 'paris.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'fastandfurious', 'host' => 'fastandfurious.cubedesigners.com', 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
+        //['name' => 'godzilla', 'host' => 'godzilla.cubedesigners.com', 'weight' => 1, 'region' => Region::EUROPE,'local'=>false],
+        ['name' => 'her', 'host' => 'her2.cubedesigners.com', 'weight' => 4, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'isleofdogs', 'host' => 'paris.cubedesigners.com', 'port' => 9458, 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'jumanji', 'host' => 'paris.cubedesigners.com', 'port' => 9459, 'weight' => 2, 'region' => Region::EUROPE, 'local' => false],
+        ['name' => 'kingkong', 'host' => 'kingkong.cubedesigners.com', 'weight' => 6, 'region' => Region::USA, 'local' => true],
     ];
 
     /**
@@ -89,7 +87,7 @@ class Farm
             if (self::$_forceServer && $farmServer['name'] === self::$_forceServer) {
                 return $farmServer;
             }
-            if ($preferLocal && $farmServer['name'] === self::LOCAL_SERVER) {
+            if ($preferLocal && $farmServer['local'] && $farmServer['region'] === self::getRegion()) {
                 $hat = [$k];
                 break;
             }
index 56751891f72fc474ce6e4aa2a8d19866bd9ac696..fff829a03f81b70bc5395c0a2ae1806915da14b6 100644 (file)
@@ -138,7 +138,7 @@ class FluidbookDocument extends ToolboxModel
     public function extractTexts()
     {
         Farm::extractTexts($this->getPDFSource(), $this->path(), 'standard', 'fluidbook', '');
-        Farm::extractHighlightsData($this->getPDFSource(), $this->path(), 'standard', 'standard');
+        Farm::extractHighlightsData($this->getPDFSource(), $this->path(), 'standard', '');
     }
 
     public function extractLinks()