diff --git a/SourceWebSVN/SourceWebSVN.php b/SourceWebSVN/SourceWebSVN.php
index 39afd37..2fb0f39 100644
--- a/SourceWebSVN/SourceWebSVN.php
+++ b/SourceWebSVN/SourceWebSVN.php
@@ -19,6 +19,7 @@
function register() {
$this->name = lang_get( 'plugin_SourceWebSVN_title' );
$this->description = lang_get( 'plugin_SourceWebSVN_description' );
+ $this->page = 'config_page';
$this->version = '0.13';
$this->requires = array(
@@ -31,6 +32,12 @@
$this->url = 'http://leetcode.net';
}
+ function config() {
+ return array(
+ 'svnpath' => '',
+ );
+ }
+
function get_types( $p_event ) {
return array( 'svn' => lang_get( 'plugin_SourceWebSVN_svn' ) );
}
@@ -229,14 +236,38 @@
}
function check_svn() {
- if ( is_blank( `svn help` ) ) {
+ $svn = $this->svn_call();
+
+ if ( is_blank( `$svn help` ) ) {
trigger_error( ERROR_GENERIC, ERROR );
}
}
- function svn_call( $p_repo ) {
- $t_call = 'svn --non-interactive';
+ function svn_call( $p_repo=null ) {
+ static $s_call;
+ # Generate, validate, and cache the SVN binary path
+ if ( is_null( $s_call ) ) {
+ $t_path = plugin_config_get( 'svnpath' );
+ if ( !is_blank( $t_path ) && is_dir( $t_path ) ) {
+ $s_call = $t_path . DIRECTORY_SEPARATOR . 'svn';
+
+ if ( !is_file( $s_call ) || !is_executable( $s_call ) ) {
+ $s_call = 'svn';
+ }
+
+ } else {
+ $s_call = 'svn';
+ }
+ }
+
+ # If not given a repo, just return the base SVN binary
+ if ( is_null( $p_repo ) ) {
+ return $s_call;
+ }
+
+ # With a repo, add arguments for repo info
+ $t_call = $s_call . ' --non-interactive';
$t_username = $p_repo->info['svn_username'];
$t_password = $p_repo->info['svn_password'];
@@ -247,6 +278,7 @@
$t_call .= ' --password ' . $t_password;
}
+ # Done
return $t_call;
}
diff --git a/SourceWebSVN/lang/strings_english.txt b/SourceWebSVN/lang/strings_english.txt
index 99e6c4e..59643c3 100644
--- a/SourceWebSVN/lang/strings_english.txt
+++ b/SourceWebSVN/lang/strings_english.txt
@@ -23,3 +23,7 @@
$s_plugin_SourceWebSVN_websvn_path = 'WebSVN Path
(From repository root)';
$s_plugin_SourceWebSVN_standard_repo = 'Standard Repository
(trunk/branches/tags)';
+$s_plugin_SourceWebSVN_configuration = 'Configuration';
+$s_plugin_SourceWebSVN_update = 'Configuration';
+$s_plugin_SourceWebSVN_svnpath = 'Path to Subversion CLI';
+
diff --git a/SourceWebSVN/pages/config_page.php b/SourceWebSVN/pages/config_page.php
new file mode 100644
index 0000000..432f4fe
--- /dev/null
+++ b/SourceWebSVN/pages/config_page.php
@@ -0,0 +1,45 @@
+
+
+
+
+
+