]> _ Git - fluidbook_processfarm.git/commitdiff
wip #7684
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 16:02:44 +0000 (18:02 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 7 Aug 2025 16:02:44 +0000 (18:02 +0200)
app/composer.json
app/process.php

index da61da8f1d720d0c8e2b311d0733ad3d606fbff9..03362c7a1759a6c52996887d9c51ba28c8a0cf56 100644 (file)
@@ -24,6 +24,7 @@
   "prefer-stable": true,
   "require": {
     "php": ">=8.4",
-    "fluidbook/tools": "dev-master"
+    "fluidbook/tools": "dev-master",
+    "slim/slim": "^4.14"
   }
-}
\ No newline at end of file
+}
index 3e7d22cc34be586db96a5aea610281932f841034..0d8a6921a36a7faa9858403852c86bd62a10e2dc 100644 (file)
@@ -4,9 +4,36 @@ use Fluidbook\Farmer\PDFOperations;
 use Fluidbook\Farmer\ProcessFile;
 use Fluidbook\Farmer\ProcessToolboxDocumentFile;
 use Fluidbook\Farmer\ProcessToolboxPDFFile;
+use Illuminate\Cache\CacheManager;
+use Illuminate\Container\Container;
+use Illuminate\Filesystem\Filesystem;
+use Slim\Factory\AppFactory;
 
 require_once __DIR__ . "/vendor/autoload.php";
 
+$app = AppFactory::create();
+
+$container = new Container;
+
+// The CacheManager creates the cache "repository" based on config values
+// which are loaded from the config class in the container.
+// More about the config class can be found in the config component; for now we will use an array
+$container['config'] = [
+    'cache.default' => 'file',
+    'cache.stores.file' => [
+        'driver' => 'file',
+        'path' => '/tmp/cache',
+    ]
+];
+
+$container['files'] = new Filesystem;
+
+// Create the CacheManager
+$cacheManager = new CacheManager($container);
+
+// Get the default cache driver (file in this case)
+$cache = $cacheManager->store();
+
 if (isset($argv)) {
     parse_str(implode('&', array_slice($argv, 1)), $_POST);
 }
@@ -56,6 +83,7 @@ try {
     die($res);
 } catch (Exception $e) {
     @ob_end_clean();
-    error_log($_POST['operation'] . ' !! ' . $e->getMessage() . ' ' . json_encode($_POST));
+    error_log($_POST['operation'] . ' !! ' . $e->getMessage() . json_encode($_POST));
+    error_log($e->getTraceAsString());
     die('!!' . $e->getMessage());
 }
\ No newline at end of file