
Andy S - 2010-05-04 10:57:25 -
In reply to message 13 from Ondra Rafaj
to implement file type (eg file or directory):
in definitions.php, add this definition:
define("SVN_IS_DIR", "D:collection");
Then in the getDirectoryFiles function in the main class:
1. add the following to the $fileinfo array:
SVN_IS_DIR => "file-type"
2. replace (in the foreach loop):
if ( $last != "") {
$tmp[ $fileinfo[$last] ] = $value;
$last = "";
continue;
}
WITH
if ( $last != "") {
$tmp[ $fileinfo[$last] ] = $value;
if ($last == SVN_IS_DIR) {
$tmp[ $fileinfo[SVN_IS_DIR] ] = 'directory';
}else{
if ( !isset( $tmp[ $fileinfo[SVN_IS_DIR] ] ) )
$tmp[ $fileinfo[SVN_IS_DIR] ] = 'file';
}
$last = "";
continue;
}
This will give you another element "file-type" with content either "directory" or "file".
Hope this helps, and fantastic class!