private function _list_files($stop_on_file = false)
{
if (sizeof($this->compressed_list)) {
$this->set_debug('Returning already loaded file list.');
return $this->compressed_list;
}
// Open file, and set file handler
$fh = fopen($this->_zip_file, 'r');
$this->fh =& $fh;
if (!$fh) {
$this->set_error('Failed to load file: ' . $this->_zip_file);
return false;
}
$this->set_debug('Loading list from "End of Central Dir" index list...');
if (!$this->_load_file_list_by_eof($fh, $stop_on_file)) {
$this->set_debug('Failed! Trying to load list looking for signatures...');
if (!$this->_load_files_by_signatures($fh, $stop_on_file)) {
$this->set_debug('Failed! Could not find any valid header.');
$this->set_error('ZIP File is corrupted or empty');
return false;
}
}
return $this->compressed_list;
}