diff --git a/src/core/etl/src/Flow/ETL/ConfigBuilder.php b/src/core/etl/src/Flow/ETL/ConfigBuilder.php index eaf168991..9e9d5edcb 100644 --- a/src/core/etl/src/Flow/ETL/ConfigBuilder.php +++ b/src/core/etl/src/Flow/ETL/ConfigBuilder.php @@ -48,12 +48,21 @@ public function build() : Config { $this->id ??= \uniqid('flow_php', true); $this->serializer ??= new CompressingSerializer(); - $this->cache ??= new LocalFilesystemCache( - \is_string(\getenv(Config::CACHE_DIR_ENV)) && \realpath(\getenv(Config::CACHE_DIR_ENV)) - ? \getenv(Config::CACHE_DIR_ENV) - : \sys_get_temp_dir(), - $this->serializer - ); + $cachePath = \is_string(\getenv(Config::CACHE_DIR_ENV)) && \realpath(\getenv(Config::CACHE_DIR_ENV)) + ? \getenv(Config::CACHE_DIR_ENV) + : \sys_get_temp_dir() . '/flow_php/'; + + if ($this->cache === null) { + if (!\file_exists($cachePath)) { + \mkdir($cachePath, 0777, true); + } + + $this->cache = new LocalFilesystemCache( + $cachePath, + $this->serializer + ); + } + $this->externalSort ??= new MemorySort( $this->id, $this->cache,