note 81972 added to ref.svn

From: Date: Fri, 21 Mar 2008 20:23:04 +0000
Subject: note 81972 added to ref.svn
Groups: php.notes 
Request: Send a blank email to php-notes+get-137309@lists.php.net to get a copy of this message
The Subversion functions work quite well for me, after some searching. I needed some time though to find out how they all worked together, but this is a basic example of svn_fs_is_file: <?php # Get a handle to the on-disk repository. Note that this # is NOT a checked out project, but the actual svn repository! $repos_handle = svn_repos_open('/var/lib/svn'); $fs_handle = svn_repos_fs($repos_handle); # Now we need to open a revision because that's what the # svn_fs_* methods need. You'll probably want the latest # revision and we have a helper method for that. $youngest_rev = svn_fs_youngest_rev($fs_handle); $fs_rev_handle = svn_fs_revision_root($fs_handle, $youngest_rev); # Now we can actually start doing stuff, for example the # svn_fs_is_file call: print_r(svn_fs_is_file($fs_rev_handle, '/a-file.txt')); ?> There is one important thing to note about this all. You cannot let the handles expire while doing any calls to svn_fs_*. When implementing a helper class, I cached the first and third handle, but not the second one. PHP crashes hard when you do this. Keep references to all handles you get while you're calling the svn_fs_* methods. ---- Server IP: 208.69.120.35 Probable Submitter: 82.168.227.166 ---- Manual Page -- http://www.php.net/manual/en/ref.svn.php Edit -- https://master.php.net/note/edit/81972 Del: integrated -- https://master.php.net/note/delete/81972/integrated Del: useless -- https://master.php.net/note/delete/81972/useless Del: bad code -- https://master.php.net/note/delete/81972/bad+code Del: spam -- https://master.php.net/note/delete/81972/spam Del: non-english -- https://master.php.net/note/delete/81972/non-english Del: in docs -- https://master.php.net/note/delete/81972/in+docs Del: other reasons-- https://master.php.net/note/delete/81972 Reject -- https://master.php.net/note/reject/81972 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#137309) next »