PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File System » VFS » Bug #4533

Error at file (file.php)

Details

Submitted2005-06-06 05:34 UTC
Fromkadefa_elmasry at hotmail dot com
Assignedyunosh
StatusClosed
PackageVFS
PHP Version5.0.3
OSWindowsXP
Roadmaps(Not assigned)

Comments

[2005-06-06 05:34 UTC] kadefa_elmasry at hotmail dot com

Description:
------------
Just to get a flavour of the VFS, I tried the following code

<?php
include("VFS/VFS.php");
include("VFS/VFS/file.php");

$myfiles=new VFS_file(array('vfsroot'=>'.'));
print_r( $myfiles->listFolders());
?>

This shows me an error at file: file.php line: 497

According to my understanding of the system, I think this line should be corrected to be:

$folders[] = array('val' => $path . '/' . $files['name'],
'abbrev' => $files['name'],
'label' => $path . '/' . $files['name']);

[2005-06-06 09:15 UTC] kadefa_elmasry at hotmail dot com

The original code is:
foreach ($folderList as $files) {
$folders[$folder['val']] = array('val' => $path . '/' . $files['name'],
'abbrev' => $files['name'],
'label' => $path . '/' . $files['name']);
}

The error is that the variable $folder is unidefined.

If the idea is to just append the new folders to the list, My code would be correct.

[2005-06-08 06:30 UTC] kadefa_Elmasry at hotmail dot com

The problem is there is no such a variable called $folder.

So the code issues an error of undefined index
$folder['val']

It could be a typo, I'm not understanding what should this $folder['val'] represent. If you want the folder list to be indexed by the file names, you may use $files['name'].

Regards