From eb5935933e48a586778d363d07d5129a20aa6226 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 7 Aug 2025 18:02:44 +0200 Subject: [PATCH] wip #7684 --- app/composer.json | 5 +++-- app/process.php | 30 +++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/app/composer.json b/app/composer.json index da61da8..03362c7 100644 --- a/app/composer.json +++ b/app/composer.json @@ -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 +} diff --git a/app/process.php b/app/process.php index 3e7d22c..0d8a692 100644 --- a/app/process.php +++ b/app/process.php @@ -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 -- 2.39.5