Re: SVN PHP

From: Date: Thu, 09 Mar 2006 13:39:39 +0000
Subject: Re: SVN PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-231713@lists.php.net to get a copy of this message
Jon Morgan wrote:
Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using >2&1). If I use the same method to call "svnlook author", etc. it work fine, the only problem is when using the "svn" command line program.
        $output = array ();
        $err = false;
        $cmd = "svn info http://172.16.0.32/svn/java/trunk >2&1";
        if ($handle = popen($cmd, "r"))
        {
                $firstline = true;
                while(!feof($handle))
                {
                   $line = fgets($handle);
                   if($firstline && $line == "")
                   {
                      $err = true;
                   }
                   $firstline = false;
                   $output[] = rtrim($line);
                }
                pclose($handle);
                if(!$err)
                    print $output;
        }
Any help would be appreciated. Cheers, J. Maybe the svn pecl extension can help,
http://pecl.php.net/package/svn cheers, Jens

« previous php.general (#231713) next »