Ok so I am writing a PHP script that will gather some information into a file and the push it up via SVN. I am running into a problem with pushing it up via SVN.

shell_exec("svn commit -m $message store-webapp-test-selenium-$storeCode --password $svnPassword");

I have even tried it like this

shell_exec("svn commit -m $message store-webapp-test-selenium-$storeCode --username $svnUsername --password $svnPassword");

Any thoughts

Recommended Answers

All 2 Replies

Ok so to throw a possible issue but in my password for the svn there is a $ in it. Could this be causing the issue?

Yes, that could be the issue. When passing strings from PHP to the shell, make sure to escape them with escapeshellarg().

see: http://php.net/manual/en/function.escapeshellarg.php

btw, the reason the $ is causing a problem is because the shell sees it as the token that begins a variable. When using escapeshellarg() the meta characters such as $ should be escaped for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.