diff --git a/src/SPC/builder/extension/sodium.php b/src/SPC/builder/extension/sodium.php new file mode 100644 index 00000000..18059774 --- /dev/null +++ b/src/SPC/builder/extension/sodium.php @@ -0,0 +1,35 @@ +removeLineContainingString(); + } + + private function removeLineContainingString(): bool + { + $path = SOURCE_PATH . '/php-src/ext/sodium/config.m4'; + $search = '-Wno-logical-op'; + if (!file_exists($path)) { + return false; + } + $content = file_get_contents($path); + $lines = preg_split('/\r\n|\n/', $content); + $filteredLines = array_filter($lines, function ($line) use ($search) { + return strpos($line, $search) === false; + }); + $newContent = implode("\n", $filteredLines); + file_put_contents($path, $newContent); + return true; + } +}