[chora] Followup (Re: "Can't check path...")

Chuck Hagenbuch chuck at horde.org
Sun Nov 12 08:59:07 PST 2006


Quoting Eric <spamsink at scoot.netis.com>:

> So, apparently $dir->browseDir($cache, true, $atticFlags) returns  
> some kind of a pear error object that is interpreted as  
> "'/root/.subversion': Permission denied".
>
> I'm not getting these kinds of errors in any of the other horde  
> applications I'm running (turba, nag, passwd.  I'm hoping that means  
> there's a good chance that the pear installation is OK (in any case,  
> it was there when I started working with the horde apps and I  
> haven't changed anything).

Right; PEAR_Error is kind of like exceptions for PHP 4 (which didn't  
have exceptions). It's not a problem with the PEAR install, it's an  
error being returned from the VC functions - in this case browseDir,  
which is trying to list the files in the top level of the repository.

> The error indicates a return from a VC:: call, and the only one of  
> those prior to here in the code is $VC->queryDir($where) in  
> browse.php line 20.  How do I find out the return types of things  
> like $VC->queryDir() and what is the best way to display them for  
> debugging?

Look in your Horde framework dir - framework/VC/VC.php, or  
framework/VC/VC/svn.php (or libs/VC/svn.php depending on what  
framework setup you have).

> ... will display "Hello, World") in an error box on the browser, but  
> execution then stops and anyway, I haven't figured out how to  
> display variables as in the C printf() or C++ cout.

http://php.net/var-dump is a good starting point. If you want to  
create the Horde error box with a debug message, you could do  
something like:

$GLOBALS['notification']->push(var_export($variable, true), 'horde.error');

-chuck

-- 
"we are plastered to the windshield of the bus that is time." - Chris


More information about the chora mailing list