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, 24 May 2013

view this page in

svn_checkout

(PECL svn >= 0.1.0)

svn_checkoutDescarga una copia de trabajo desde el repositorio

Descripción

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

Descarga una copia de trabajo desde el repositorio en repos a targetpath con la revisión revision.

Parámetros

repos

Cadena URL con la ruta al directorio en el repositorio a descargar.

targetpath

Cadena con la ruta local del directorio en donde descargar.

Nota: Las rutas relativas se resolverán como si el directorio de trabajo actual es el que contiene el binario de PHP. Para utilizar el directorio de trabajo que contiene el script a llamar, use realpath() o dirname(__FILE__).

revision

Número de la revisión del repositorio a descargar. Por defecto es HEAD, la más reciente.

flags

Cualquier combinación de SVN_NON_RECURSIVE y SVN_IGNORE_EXTERNALS.

Valores devueltos

Devuelve TRUE en caso de éxito o FALSE en caso de error.

Notas

Advertencia

Esta función ha sido declarada EXPERIMENTAL. Su comportamiento, su nombre y la documentación que le acompaña puede cambiar sin previo aviso en futuras versiones de PHP. Use esta función bajo su propio riesgo.

Ejemplos

Ejemplo #1 Ejemplo básico

Este ejemplo demustra como descargar un directorio desde un repositorio a un directorio llamado calc:

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

La llamada a dirname(__FILE__) es necesaria para poder convertir la ruta relativa de path en una ruta absoluta. Si calc existe, también se puede usar realpath() para obtener la ruta absoluta.

Ver también



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 | sitemap | contact | advertising | mirror sites