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

search for in the

svn_cleanup> <svn_cat
[edit] Last updated: Fri, 14 Jun 2013

view this page in

svn_checkout

(PECL svn >= 0.1.0)

svn_checkoutExtrait une copie de travail depuis un référentiel

Description

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

Extrait une copie de travail depuis le référentiel repos vers targetpath à la révision revision.

Liste de paramètres

repos

URL du dossier dans le référentiel à extraire.

targetpath

Chemin local du dossier dans lequel on effectue l'extraction

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 révision du référentiel à extraire. Par défaut, vaut HEAD, la révision la plus récente.

flags

Toute combinaison de SVN_NON_RECURSIVE et SVN_IGNORE_EXTERNALS.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

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 extraire un dossier depuis un référentiel 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.

Voir aussi



add a note add a note User Contributed Notes svn_checkout - [1 notes]
up
-1
Anonymous
5 years ago
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.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites