S
S
Salavat Sitdikov2012-05-14 17:39:26
PHP
Salavat Sitdikov, 2012-05-14 17:39:26

SVN Commit via PHP

There is a following task. When the controller is called, one of the files is updated, you must immediately commit it to the server.

The solution that was first noticed is the pecl's svn php library. But, it works through a stump-deck. The second option is to use system/exec. Not yet considered.

Does anyone have any experience and would like to share it?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
G
Gleb Starkov, 2012-05-15
@zona7o

/**
 * $ sudo pecl install svn
 * OR
 * $ sudo apt-get install php5-svn
 * 
 * http://www.php.net/manual/ru/svn.installation.php
 */

// SVN_FILE - файл для коммита

svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, 'username);
svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, 'userpassword');
svn_commit('this_is_comment', array(SVN_FILE));

M
mr_idiot, 2012-05-14
@mr_idiot

And why is the option with the execution of the command not considered, if not a secret?

C
CrazySquirrel, 2012-05-14
@CrazySquirrel

I don’t quite understand why this might be needed, but I would do it through the flag + crontab + bash script

G
Gleb Starkov, 2012-05-14
@colonel

Pecl means this one ?
Have used it for a while, worked great.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question