Update of /cvsroot/phpicalendar/phpicalendar
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4581
Modified Files:
caldav.php
Log Message:
* Depth: header support
* Committing current WebDAV library
Index: caldav.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/caldav.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** caldav.php 13 Apr 2006 05:10:24 -0000 1.2
--- caldav.php 14 Apr 2006 02:50:09 -0000 1.3
***************
*** 149,159 ****
}
- // FIXME Handle depth
// FIXME Use file_exists
function propfind($options, &$files) {
$files = array();
! $paths = array();
! $path = $options['path'];
! while (isset($path)) {
$file = array();
$file['path'] = $path;
--- 149,159 ----
}
// FIXME Use file_exists
function propfind($options, &$files) {
$files = array();
! $paths = array(array($options['path'], 0));
! while (!empty($paths)) {
! list ($path, $depth) = array_pop($paths);
!
$file = array();
$file['path'] = $path;
***************
*** 169,184 ****
$file['props'][] = $this->mkprop('resourcetype', 'collection');
! $handle = opendir($absolutePath);
! if (!$handle) {
! return;
! }
! while (($pathComponent = readdir($handle)) !== false) {
! if ($pathComponent != '.' && $pathComponent != '..') {
! $paths[] = $path != '' ? "$path/$pathComponent" :
! $pathComponent;
}
}
- closedir($handle);
} else {
$file['props'][] = $this->mkprop('getcontentlength',
--- 169,187 ----
$file['props'][] = $this->mkprop('resourcetype', 'collection');
! if ($depth < $options['depth']) {
! $handle = opendir($absolutePath);
! if (!$handle) {
! return;
! }
! while (($pathComponent = readdir($handle)) !== false) {
! if ($pathComponent != '.' && $pathComponent != '..') {
! $paths[] = array($path != '' ?
! "$path/$pathComponent" : $pathComponent,
! $depth + 1);
! }
}
+ closedir($handle);
}
} else {
$file['props'][] = $this->mkprop('getcontentlength',
***************
*** 188,192 ****
$files[] = $file;
- $path = array_pop($paths);
}
--- 191,194 ----
***************
*** 212,218 ****
function report($options, &$files) {
$files = array();
! $paths = array();
! $path = $options['path'];
! while (isset($path)) {
$file = array();
$file['path'] = $path;
--- 214,221 ----
function report($options, &$files) {
$files = array();
! $paths = array(array($options['path'], 0));
! while (!empty($paths)) {
! list ($path, $depth) = array_pop($paths);
!
$file = array();
$file['path'] = $path;
***************
*** 228,243 ****
$file['props'][] = $this->mkprop('resourcetype', 'collection');
! $handle = opendir($absolutePath);
! if (!$handle) {
! return;
! }
! while (($pathComponent = readdir($handle)) !== false) {
! if ($pathComponent != '.' && $pathComponent != '..') {
! $paths[] = $path != '' ? "$path/$pathComponent" :
! $pathComponent;
}
}
- closedir($handle);
} else {
$file['props'][] = $this->mkprop('getcontentlength',
--- 231,249 ----
$file['props'][] = $this->mkprop('resourcetype', 'collection');
! if ($depth < $options['depth']) {
! $handle = opendir($absolutePath);
! if (!$handle) {
! return;
! }
! while (($pathComponent = readdir($handle)) !== false) {
! if ($pathComponent != '.' && $pathComponent != '..') {
! $paths[] = array($path != '' ?
! "$path/$pathComponent" : $pathComponent,
! $depth + 1);
! }
}
+ closedir($handle);
}
} else {
$file['props'][] = $this->mkprop('getcontentlength',
***************
*** 247,251 ****
$files[] = $file;
- $path = array_pop($paths);
}
--- 253,256 ----
|