[gollem] problem with "change directory" and file backend
Liam Hoekenga
liamr at umich.edu
Wed Mar 5 12:21:59 PST 2003
Ok... so the problem seems to be that if use "change directory" with a
relative path, it tries to change to
vfsroot / path
instead of
vfsroot / current directory / path
I got around that by adding this to the CHANGE_DIRECTORY block in
manager.php ...
Index: manager.php
===================================================================
RCS file: /repository/gollem/manager.php,v
retrieving revision 1.61
diff -U2 -r1.61 manager.php
--- manager.php 27 Feb 2003 21:32:06 -0000 1.61
+++ manager.php 5 Mar 2003 17:08:26 -0000
@@ -58,4 +58,8 @@
if (array_key_exists('change_directory', $_POST) &&
!empty($_POST['change_directory'])) {
+ if ( strpos($_POST['change_directory'], DIRECTORY_SEPARATOR)
!== 0 ) {
+ $_POST['change_directory'] =
$_SESSION['gollem'][$backend_key]['dir']
+ . DIRECTORY_SEPARATOR . $_POST['change_directory'];
+ }
$result = Gollem::setDir($_POST['change_directory'],
$backend_key);
if (is_a($result, 'PEAR_Error')) {
but if I do that, that breaks the tilde expansion that we submitted as
a patch last night (and we'd very much like to see tilde expansion
become part of Gollem and / or the VFS file backend).
At my last attempt at doing tilde expansion, Chuck had suggested that
we implement that in VFS instead of Gollem itself (to avoid building
dependancies for a specific VFS backend into gollem itself).
I guess my question is... what should horde/lib/VFS/file.php's
_getNativePath be passed? Should it be able to handle relative paths,
or only absolute? Because w/o any of our changes, it only do absolute
paths. Should we make sure that any path we send it has been turned
into an absolute path before it gets there? If so, where's the logical
place to put the tilde expansion stuff w/o building a "file" backend
dependency into Gollem (as ~username is a specialize relative path)?
Liam
More information about the gollem
mailing list