$dir = opendir($rootdir);
- while ($file = readdir($dir)) {
+ while (false !== ($file = readdir($dir))) {
if ($file != '.' and $file != '..') {
$fullfile = $rootdir .'/'. $file;
if (filetype($fullfile) == 'dir') {
function get_subdirs($directory){
$opendirectory = opendir( $directory );
- while($filename = readdir($opendirectory)) {
+ while(false !== ($filename = readdir($opendirectory))) {
if (is_dir($directory.$filename) and $filename != ".." and $filename != "."){
$subdirs[] = $filename;
}
}
// Loop through all directory entries, and construct two temporary arrays containing files and sub directories
- while($entry = readdir($handle)) {
+ while(false !== ($entry = readdir($handle))) {
if (is_dir($dir. $slash .$entry) && $entry != ".." && $entry != "." && $entry != $excludeddir) {
$dir_subdirs[] = $dir. $slash .$entry;
}
$results = null;
$dir = opendir($rootdir);
- while ($file=readdir($dir)) {
+ while (false !== ($file=readdir($dir))) {
if ($file=="." || $file=="..") {
continue;
}
$results = "";
$dir = opendir($rootdir);
- while ($file=readdir($dir)) {
+ while (false !== ($file=readdir($dir))) {
if ($file=="." || $file=="..") {
continue;
}
$status = check_dir_exists($to_file, true, true);
}
$dir = opendir($from_file);
- while ($file=readdir($dir)) {
+ while (false !== ($file=readdir($dir))) {
if ($file=="." || $file=="..") {
continue;
}
notify("Moving location of assignment files...");
$basedir = opendir("$CFG->dataroot");
- while ($dir = readdir($basedir)) {
+ while (false !== ($dir = readdir($basedir))) {
if ($dir == "." || $dir == ".." || $dir == "users") {
continue;
}
notify("Moving location of assignment files...");
$basedir = opendir("$CFG->dataroot");
- while ($dir = readdir($basedir)) {
+ while (false !== ($dir = readdir($basedir))) {
if ($dir == "." || $dir == ".." || $dir == "users") {
continue;
}
// get list of hotpot files in this folder
if ($dh = @opendir($xml_quiz->filepath)) {
- while ($file = @readdir($dh)) {
+ while (false !== ($file = @readdir($dh))) {
if (preg_match('/\.(jbc|jcl|jcw|jmt|jmx|jqz|htm|html)$/', $file)) {
$hotpot->references[] = "$xml_quiz->reference/$file";
}
/// Loops though dir building a list of all relevent entries. Ignores files.
/// Asks for deploy if admin user AND no serialized file found.
- while (false != ($filename = readdir($repository_dir))) {
+ while (false !== ($filename = readdir($repository_dir))) {
if ($filename != '.' && $filename != '..' && is_dir("$CFG->repository/$directory/$filename")) {
unset($item);
$item->type = '';
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
-// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
+// Copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// //
// This program is free software; you can redistribute it and/or modify //
$dirpath = "$CFG->repository/$file";
$dir = opendir($dirpath);
- while (false != ($filename = readdir($dir))) {
+ while (false !== ($filename = readdir($dir))) {
if ($filename != '.' && $filename != '..') {
$path = $dirpath.'/'.$filename;
if (is_dir($path) && file_exists("$path/imsmanifest.xml")) {
$path=EWIKI_INIT_PAGES;
if (!empty($path)) {
if ($dh = @opendir($path=EWIKI_INIT_PAGES)) {
- while ($filename = readdir($dh)) {
+ while (false !== ($filename = readdir($dh))) {
#### MOODLE CHANGE TO SOLVE BUG #3830. Original doesn't support dots in names.
//Orig->if (preg_match('/^(['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+\w*)+/', $filename)) {
if ($filename == clean_filename($filename) && !is_dir($path.'/'.$filename)) {
else {
ewiki_database("INIT", array());
if ($dh = @opendir($path=EWIKI_INIT_PAGES)) {
- while ($filename = readdir($dh)) {
+ while (false !== ($filename = readdir($dh))) {
if (preg_match('/^(['.EWIKI_CHARS_U.']+['.EWIKI_CHARS_L.']+\w*)+/', $filename)) {
$found = ewiki_database("FIND", array($filename));
if (! $found[$filename]) {
}
-?>
\ No newline at end of file
+?>
#-- read in one directory
$dh = opendir($dir);
- while ($fn = readdir($dh)) {
+ while (false !== ($fn = readdir($dh))) {
#-- skip over . and ..
if ($fn[0] == ".") { continue; }
-?>
\ No newline at end of file
+?>
}
// Loop through all directory entries, and construct two temporary arrays containing files and sub directories
- while($entry = readdir($handle)) {
+ while(false !== ($entry = readdir($handle))) {
if (is_dir($dir. $slash .$entry) && $entry != ".." && $entry != ".") {
$dir_subdirs[] = $dir. $slash .$entry;
}
function fulldelete($location) {
if (is_dir($location)) {
$currdir = opendir($location);
- while ($file = readdir($currdir)) {
+ while (false !== ($file = readdir($currdir))) {
if ($file <> ".." && $file <> ".") {
$fullfile = $location."/".$file;
if (is_dir($fullfile)) {