From 1b7dd49d58577fe1f93c5b699ee9b283732699e4 Mon Sep 17 00:00:00 2001 From: Vidar Date: Mon, 20 Aug 2018 12:03:17 +0200 Subject: [PATCH] EZP-29505: ezxmltext -> richtext conversion: memory_limit per child process (#65) --- bundle/Command/ConvertXmlTextToRichTextCommand.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bundle/Command/ConvertXmlTextToRichTextCommand.php b/bundle/Command/ConvertXmlTextToRichTextCommand.php index a70d4d2f..7f3c1ea4 100644 --- a/bundle/Command/ConvertXmlTextToRichTextCommand.php +++ b/bundle/Command/ConvertXmlTextToRichTextCommand.php @@ -472,6 +472,13 @@ private function createChildProcess($dryRun, $checkDuplicateIds, $checkIdValues, '--image-content-types=' . implode(',', $this->imageContentTypeIdentifiers), "--user=$this->userLogin", ]; + + $memoryLimit = ini_get('memory_limit'); + if ($memoryLimit !== null) { + array_unshift($arguments, "memory_limit=$memoryLimit"); + array_unshift($arguments, '-d'); + } + if ($dryRun) { $arguments[] = '--dry-run'; }