head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.10 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.8 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.6 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.4 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.2 pkgsrc-2025Q1-base:1.2; locks; strict; comment @# @; 1.2 date 2025.03.03.16.02.40; author taca; state Exp; branches; next 1.1; commitid eruNKklg58U4DDLF; 1.1 date 2025.03.03.15.21.05; author manu; state Exp; branches; next ; commitid yBeKlxJmOZmToDLF; desc @@ 1.2 log @multimedia/php-avideo: fix broken patch @ text @$NetBSD: patch-objects_functionsExec.php,v 1.1 2025/03/03 15:21:05 manu Exp $ Implement getDirSize in pure PHP This avoids starting an external program, and make the code more compatible. For instnace, BSD du comand does not have a -b option. But the function should probably be moved in another file, objects/functionsExec.php being dedicated to running external programs. From upstream https://github.com/WWBN/AVideo/pull/9907 diff --git a/objects/functionsExec.php b/objects/functionsExec.php index 23c55f8dd2de..b0b9af6e30cb 100644 --- ./objects/functionsExec.php.orig +++ ./objects/functionsExec.php @@@@ -120,35 +120,16 @@@@ function getDirSize($dir, $forceNew = fa _error_log("getDirSize: start {$dir}"); - if (isWindows()) { - $return = foldersize($dir); - $_getDirSize[$dir] = $return; - return $return; - } else { - $command = "du -sb {$dir}"; - exec($command . " < /dev/null 2>&1", $output, $return_val); - if ($return_val !== 0) { - _error_log("getDirSize: ERROR ON Command {$command}"); - $return = 0; - $_getDirSize[$dir] = $return; - return $return; - } else { - if (!empty($output[0])) { - preg_match("/^([0-9]+).*/", $output[0], $matches); - } - if (!empty($matches[1])) { - _error_log("getDirSize: found {$matches[1]} from - {$output[0]}"); - $return = intval($matches[1]); - $_getDirSize[$dir] = $return; - return $return; - } - - _error_log("getDirSize: ERROR on pregmatch {$output[0]}"); - $return = 0; - $_getDirSize[$dir] = $return; - return $return; + $return = 0; + $rdi = new RecursiveDirectoryIterator($dir); + $rii = new RecursiveIteratorIterator($rdi); + foreach ($rii as $file) { + if (is_file($file)) { + $return += $file->getSize(); } } + + return $return; } function rrmdirCommandLine($dir, $async = false) @ 1.1 log @AVideo is a versatile and advanced video streaming platform tailored for individual content creators, businesses, and developers alike. It stands out with its robust suite of features that enable users to host, Key features of AVideo 1. Advanced Security & Content Protection 2. Secure Livestreaming with Recording 3. Restreaming & Multi-Platform Broadcasting 4. User-Generated Channels & Playlists 5. Monetization Options 6. Ad Integration & Promotion 7. Scalable Cloud Storage 8. Third-Party Integration & API 9. Offline Viewing & Secure Downloads @ text @d1 1 a1 1 $NetBSD$ d19 1 a19 1 @@@@ -120,35 +120,16 @@@@ function getDirSize($dir, $forceNew = false) d23 1 a23 1 - if (isWindowsServer()) { @