PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

svn_cleanup> <svn_cat
Last updated: Fri, 14 Nov 2008

view this page in

svn_checkout

(PECL svn:0.1-0.2)

svn_checkoutSynchronise une copie de travail depuis un dépôt

Description

bool svn_checkout ( string $repos , string $targetpath [, int $revision ] )

Synchronise une copie de travail depuis le dépôt repos vers targetpath à la version revision .

Liste de paramètres

repos

URL du dossier dans le dépôt à synchroniser.

targetpath

Chemin local du dossier à synchroniser

Note: Les chemins relatifs peuvent être résolus si le dossier de travail courant est l'un de ceux qui contiennent le binaire PHP. Pour utiliser le dossier de travail, utilisez la fonction realpath(), ou l'instruction dirname(__FILE__).

revision

Numéro de version du dépôt à synchroniser. Par défaut, vaut HEAD, la version la plus récente.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Notes

Avertissement

Cette fonction est EXPERIMENTALE. Cela signifie que le comportement de cette fonction, son nom et, concrètement, TOUT ce qui est documenté ici peut changer dans un futur proche, SANS PREAVIS ! Soyez-en conscient, et utilisez cette fonction à vos risques et périls.

Exemples

Exemple #1 Exemple d'utilisation

Cet exemple montre comment synchroniser un dossier depuis une dépôt vers un dossier nommé calc:

<?php
svn_checkout
('http://www.example.com/svnroot/calc/trunk'dirname(__FILE__) . '/calc');
?>

L'utilisation de dirname(__FILE__) est nécessaire afin de convertir le chemin relatif du dossier calc en un chemin absolu. Si calc existe, vous pouvez également utiliser realpath() pour récupérer un chemin absolu.



add a note add a note User Contributed Notes
svn_checkout
Anonymous
14-Apr-2008 10:08
The current version of svn does not seem to indicate an error properly when passed an invalid string, so it's important to check your paths and to clean them before calling svn or it will just not work.

Under Windows getting the format correctly is a bit tricky, so here's the format it wants:

file:///c:/path/to/repos

Note the following:
1) The extra slash after the protocol designates 'root' under Unix (file:///path/to/repos points to /path/to/repos in Unix), but it seems to have no real meaning in the string on Windows (?).

2) Paths are usually reported with backslashes, so you'll need to replace those with slashes manually before handing them off to Subversion.

svn_cleanup> <svn_cat
Last updated: Fri, 14 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites