[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Returncode 1 when invoking SVN from a PHP-script

From: Ryan Schmidt <subversion-2006d_at_ryandesign.com>
Date: 2006-12-22 18:09:31 CET

On Dec 21, 2006, at 09:29, Gerard Verhoeven wrote:

> I'm desperate, I have a script in PHP that uses an 'exec-function'
> to do an export of the HEAD of a repository.
> This script worked fine when it was used on the Subversion and PHP
> versions distributed with the 9.1 release
> of SuSE Linux. But after upgrading to the versions distributed with
> 10.1, I always get a returncode of 1.
> I've copied the command, as it is generated and used from the
> script, to a command-line and then it works
> fine, the export is being performed.
> I've tried a number of different commands instead of the 'svn
> export' (like svnlook and svnadmin) by updating
> my script, and they all work fine.
> But for example an 'svn help' doesn't work. Always when I use the
> svn-command I get an rc of 1.
>
> The command I use is:
> svn export --force --non-interactive --username user --password pw
> file:///wrk/repos/images /srv/www/images

I imagine something useful is being printed to stderr. Discover what
it is by redirecting stderr to stdout ("2>&1") and echoing the output:

<?php
exec(
        'svn export'
        . ' --force'
        . ' --non-interactive'
        . ' --username ' . escapeshellarg('user')
        . ' --password ' . escapeshellarg('pw')
        . ' file:///wrk/repos/images'
        . ' /srv/www/images'
        . ' 2>&1',
        $output,
        $return_var
);
if (0 != $return_var) {
        echo implode("\n", $output) . "\n";
}
?>

-- 
To reply to the mailing list, please use your mailer's Reply To All  
function
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 22 18:10:14 2006

This is an archived mail posted to the Subversion Users mailing list.