Project

General

Profile

Bug #21193 ยป get_dirs.patch

Administrator Admin, 2009-10-05 17:47

View differences:

t3lib/class.t3lib_div.php (working copy)
* @param string Path to list directories from
* @return array Returns an array with the directory entries as values. If no path, the return value is nothing.
*/
public static function get_dirs($path) {
if ($path) {
$d = @dir($path);
if (is_object($d)) {
while(false !== ($entry=$d->read())) {
if (@is_dir($path.'/'.$entry) && $entry!= '..' && $entry!= '.') {
$filearray[]=$entry;
public static function get_dirs($path) {
if ($path) {
$d = dir($path);
if (is_object($d)) {
while(($entry = $d->read()) !== FALSE) {
if (is_dir($path . '/' . $entry) && $entry !== '..' && $entry !== '.') {
$filearray[] = $entry;
}
}
$d->close();
} else return 'error';
} else {
return 'error';
}
return $filearray;
}
}
    (1-1/1)