How to use svn + ssh in php script?

I cannot figure out how I should access the repository from a CakePHP project called fredistrano (you can use CakePHP deployment using the Web 2.0 interface). I have fredistrano in my webcast directory on a unix shared web server. when i use tortoisesvn from my laptop i need to use svn + ssh: // username@domain.com / svnpath / trunk /. I tried using the same in fredistrano, but I keep getting the svn command "svn: network connection is unexpectedly closed". I copied and pasted the command: svn export --non-interactive --username myusername --password mypwd svn + ssh: // myusername@mydomain.com/home/myusername/svn/mydomain.com/trunk tmpDir 2> & 1 to my SSH terminal connected to a shared server and I get a password prompt, which I think is a valid SSH password prompt, not a password SVN (see this post ). fredistrano fails because it cannot work with SSH password. I noticed in the fredistrano documentation that the example uses http: // ipaddress / svn / testfor the svn url. I copied my svn into my direrctory webcast and tried this, but received a failure error message. My hosting provider is pretty strict and I doubt that I can use it. Is there a way that I can get svn + ssh to work with a PHP script as follows (fredistrano just uses shell_exec () to execute svn commands)? is there any way i can get only get svn, http or https working (or any other method that i don't know about)?

+3
source share
4 answers

I am also interested in this problem, and I hope that I am close to a solution.

- , , :

shell_exec(svn something svn+ssh://...)

$response = trim(fgets(STDIN))

[ , ]

fwrite(STDOUT, 'yourpassword');

[ , SVN - , , ]

+1

"svn: Network connection closed unexpectedly" , , / . (SVN, HTTP ..) , , -HTTP. SVN- HTTP- (, mod_dav_svn Apache).

- . .

0

- svn-? , ( ?)

0

maybe check out Subversion PHP Module (1.0.3) instead of wrapping shell_exec; it requires building from source code with phpize, ./configureand make(just built it for PHP 5.6 and Subversion 1.9.5) ... while the Apache Module mod_dav (Subversion via HTTP / HTTPS) is not required for version control, but an optional access method to repository.

0
source

Source: https://habr.com/ru/post/1718375/


All Articles