There is no $oConfig, guessing it's Api::Config() here

This commit is contained in:
Rob Emery 2025-01-11 22:30:41 +00:00
parent 4bbe93aea7
commit a41aac28d3

View file

@ -156,14 +156,14 @@ class Utils
public static function saveFile(string $filename, string $data) : void public static function saveFile(string $filename, string $data) : void
{ {
$dir = \dirname($filename); $dir = \dirname($filename);
if (!\is_dir($dir) && !\mkdir($dir, intval($oConfig->Get('security', 'dir_permissions')), true)) { if (!\is_dir($dir) && !\mkdir($dir, intval(Api::Config()->Get('security', 'dir_permissions')), true)) {
throw new \RuntimeException('Failed to create directory "'.$dir.'"'); throw new \RuntimeException('Failed to create directory "'.$dir.'"');
} }
if (false === \file_put_contents($filename, $data)) { if (false === \file_put_contents($filename, $data)) {
throw new \RuntimeException('Failed to save file "'.$filename.'"'); throw new \RuntimeException('Failed to save file "'.$filename.'"');
} }
\clearstatcache(); \clearstatcache();
\chmod($filename, intval($oConfig->Get('security', 'file_permissions'))); \chmod($filename, intval(Api::Config()->Get('security', 'file_permissions')));
/* /*
try { try {
} catch (\Throwable $oException) { } catch (\Throwable $oException) {