From 2da01a248807d9b37734fb8a8d866d7c8b7cf390 Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Sun, 7 Apr 2024 21:51:31 +0300 Subject: [PATCH] Update helpers.php --- support/helpers.php | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/support/helpers.php b/support/helpers.php index 6af847f..d44f80f 100644 --- a/support/helpers.php +++ b/support/helpers.php @@ -1,4 +1,28 @@ + * @copyright Copyright (c) 2018-2024 Zorin Projects S.P. + * @license https://www.gnu.org/licenses/agpl-3.0 GNU Affero General Public License v3.0 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * For any questions, please contact + */ use localzet\Server; use localzet\Server\Connection\TcpConnection; @@ -205,7 +229,7 @@ function copy_dir(string $source, string $dest, bool $overwrite = false): void { if (is_dir($source)) { if (!is_dir($dest)) { - mkdir($dest); + create_dir($dest); } $files = array_diff(scandir($source), ['.', '..']) ?: []; foreach ($files as $file) { @@ -256,7 +280,7 @@ function remove_dir(string $dir): bool */ function create_dir(string $dir): bool { - return mkdir($dir); + return mkdir($dir, 0777, true); } /**