svn_auth_set_parameter

(PECL svn >= 0.1.0)

svn_auth_set_parameter認証パラメータを設定する

説明

svn_auth_set_parameter(string $key, string $value): void

認証パラメータ key の値を value に設定します。 使用できるキーとその意味については 認証定数の一覧 を参照ください。

パラメータ

key

キーの名前。認証に関する定数 のいずれかを指定します。

value

そのパラメータに指定する値。 値の書式は、パラメータによって異なります。

戻り値

値を返しません。

例1 デフォルトの認証の例

この例は、SVN のデフォルトのユーザー名を 'Bob'、デフォルトのパスワードを 'abc123' に設定します。

<?php
svn_auth_set_parameter
(SVN_AUTH_PARAM_DEFAULT_USERNAME, 'Bob');
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, 'abc123');
?>

注意

警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

参考

add a note add a note

User Contributed Notes 1 note

up
2
powtac at gmx dot de
12 years ago
If you having trouble with certificate verification like this:

PHP Warning:  svn_log(): svn error(s) occured 175002 (RA  layer request failed) OPTIONS of 'https://example.com/your/repos/path': Server certificate verification failed: issuer is not trusted

Try this two steps:

1. Run

"svn log https://example.com/your/repos/path"

on the commandline and permanent accept the certificate by typing "p" when asked.

2. Use the following settings for svn_auth_set_parameter() before calling other svn functions:

<?php
svn_auth_set_parameter
(SVN_AUTH_PARAM_DEFAULT_USERNAME,             'your svn user');
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD,             'your svn users password');
svn_auth_set_parameter(PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS, true); // <--- Important for certificate issues!
svn_auth_set_parameter(SVN_AUTH_PARAM_NON_INTERACTIVE,              true);
svn_auth_set_parameter(SVN_AUTH_PARAM_NO_AUTH_CACHE,                true);

var_dump(svn_log('https://example.com/your/repos/path'));
?>

This will work for SVN client libraries below 1.6!
To Top