Показать сообщение отдельно

ООП. Класс. Сканирование директории. Помогите найти ошибку?
  #1  
Старый 28.05.2010, 19:15
DonKihot
Познающий
Регистрация: 23.05.2010
Сообщений: 44
Провел на форуме:
38453

Репутация: 2
По умолчанию ООП. Класс. Сканирование директории. Помогите найти ошибку?

Цитата:
<?php

class File_Manager{

//properties
protected $url; // current url
public $dir; // current directory
protected $df; // current file or directory
public $list_df = array(); // all files and directory in directory

//methods
public function Scan_Directory() // Initialization
{
$url = getcwd(); //current directory
if ($this->dir = opendir($this->url)) //directory is open?
{
while (false !== ($this->df = readdir($this->dir)))
{
if ($this->df != ".." and $this->df != ".") $this->list_df[]= $this->df;
}
closedir($this->dir);
}
}

}

$object = new File_Manager;
$object->Scan_Directory();

$list_df = $object->list_df;

print '<pre>';
print_r($list_df);
print '</pre>';
?>
Выводит массив (в выделенной строке), а массив пуст :-(
в масссиве должны быть файлы и папки, находящиеся в директории.
 
Ответить с цитированием