From 0567b5af913954789324275dd90b9d2e02de9a7e Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 May 2008 21:42:28 +0000 Subject: [PATCH] MDL-14617 removed PHP4 compatibility scandir() --- mod/scorm/locallib.php | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 5996e05130..bb368b3e1c 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -84,7 +84,7 @@ $repositorybrowser = '/mod/resource/type/ims/finder.php'; */ function scorm_delete_files($directory) { if (is_dir($directory)) { - $files=scorm_scandir($directory); + $files=scandir($directory); set_time_limit(0); foreach($files as $file) { if (($file != '.') && ($file != '..')) { @@ -101,27 +101,6 @@ function scorm_delete_files($directory) { return false; } -/** -* Given a diretory path returns the file list -* -* @param string $directory -* @return array -*/ -function scorm_scandir($directory) { - if (version_compare(phpversion(),'5.0.0','>=')) { - return scandir($directory); - } else { - $files = array(); - if ($dh = opendir($directory)) { - while (($file = readdir($dh)) !== false) { - $files[] = $file; - } - closedir($dh); - } - return $files; - } -} - /** * Create a new temporary subdirectory with a random name in the given path * -- 2.39.5