Login | Register
My pages Projects Community openCollabNet

Discussions > commits > [WebSVN commit] svn commit: r1286 - trunk/include

websvn
Discussion topic

Back to topic list

[WebSVN commit] svn commit: r1286 - trunk/include

Reply

Author dirkthomas
Full name Dirk Thomas
Date 2012-07-01 22:29:38 PDT
Message Author: dirkthomas
Date: 2012-07-01 22:29:18-0700
New Revision: 1286

Modified:
   trunk/include/configclass.php
   trunk/include/distconfig.php

Log:
fixed handling of file:// url prefix and updated doc (fixed #330)

Modified: trunk/include/configclass.php
Url: http://websvn.tigris​.org/source/browse/w​ebsvn/trunk/include/​configclass.php?view​=diff&pathrev=12​86&r1=1285&r​2=1286
====================​====================​====================​==================
--- trunk/include/configclass.php (original)
+++ trunk/include/configclass.php 2012-07-01 22:29:18-0700
@@ -141,7 +141,7 @@
             if (is_dir($dbfullpath) && is_readable($dbfullpath)) {
                 // And matches the pattern if specified
                 if ($this->pattern === false || preg_match($this->pattern, $name)) {
- $url = 'file:///'.$fullpath;
+ $url = $config->fileUrl​Prefix.$fullpath;
                     $url = str_replace(DIRECTOR​Y_SEPARATOR, '/', $url);
                     if ($url{strlen($url) - 1} == '/') {
                         $url = substr($url, 0, -1);
@@ -163,6 +163,7 @@
     // {{{ getRepositories()
     // return all repositories in the parent path matching pattern
     function &getRepositories() {
+ global $config;
         $repos = array();
         $handle = @opendir($this->path);
 
@@ -177,7 +178,7 @@
                 if (is_dir($dbfullpath) && is_readable($dbfullpath)) {
                     // And matches the pattern if specified
                     if ($this->pattern === false || preg_match($this->pattern, $name)) {
- $url = 'file:///'.$fullpath;
+ $url = $config->fileUrl​Prefix.$fullpath;
                         $url = str_replace(DIRECTOR​Y_SEPARATOR, '/', $url);
                         if ($url{strlen($url) - 1} == '/') {
                             $url = substr($url, 0, -1);
@@ -667,6 +668,7 @@
 
     var $quote = "'";
     var $pathSeparator = ':';
+ var $fileUrlPrefix = 'file://';
 
     var $_repositories = array();
 
@@ -710,7 +712,7 @@
     }
 
     function addExcludedPath($path) {
- $url = 'file:///'.$path;
+ $url = $this->fileUrlPrefix.$path;
         $url = str_replace(DIRECTOR​Y_SEPARATOR, '/', $url);
         if ($url{strlen($url) - 1} == '/') {
             $url = substr($url, 0, -1);
@@ -790,6 +792,8 @@
 
         // On Windows, semicolon separates path entries in a list rather than colon.
         $this->pathSeparator = ';';
+
+ $this->fileUrlPrefix = 'file:///';
     }
 
     // }}}

Modified: trunk/include/distconfig.php
Url: http://websvn.tigris​.org/source/browse/w​ebsvn/trunk/include/​distconfig.php?view=​diff&pathrev=128​6&r1=1285&r2​=1286
====================​====================​====================​==================
--- trunk/include/distconfig.php (original)
+++ trunk/include/distconfig.php 2012-07-01 22:29:18-0700
@@ -32,21 +32,21 @@
 
 // Configure these lines if your commands aren't on your path.
 //
-// $config->setSVNC​ommandPath('Path/to/​svn/command/'); // e.g. c:\\program files\\subversion\\bin
-// $config->setDiff​Path('Path/to/diff/c​ommand/');
+// $config->setSVNC​ommandPath('/path/to​/svn/command/'); // e.g. c:\\program files\\subversion\\bin
+// $config->setDiff​Path('/path/to/diff/​command/');
 
 // For syntax colouring, if option enabled...
-// $config->setEnsc​riptPath('Path/to/en​script/command/');
-// $config->setSedP​ath('Path/to/sed/com​mand/');
+// $config->setEnsc​riptPath('/path/to/e​nscript/command/');
+// $config->setSedP​ath('/path/to/sed/co​mmand/');
 
 // For delivered tarballs, if option enabled...
-// $config->setTarP​ath('Path/to/tar/com​mand/');
+// $config->setTarP​ath('/path/to/tar/co​mmand/');
 
 // For delivered GZIP'd files and tarballs, if option enabled...
-// $config->setGZip​Path('Path/to/gzip/c​ommand/');
+// $config->setGZip​Path('/path/to/gzip/​command/');
 
 // download folder/file zipped ...
-// $config->setZipP​ath('Path/to/zip/com​mand/');
+// $config->setZipP​ath('/path/to/zip/co​mmand/');
 
 // Uncomment this line to trust server certificates
 // This may useful if you use self-signed certificates and have no chance to accept the certificate once via cli
@@ -70,7 +70,7 @@
 // password; if these arguments are not needed, then pass null instead. Consult
 // the WebSvnConfig class in include/configclass.php for function details.
 //
-// Performance is much better on local repositories (e.g. accessed by file:///).
+// Performance is much better on local repositories (e.g. accessed by file://).
 // However, you can also provide an interface onto a remote repository. In this
 // case you should supply the username and password needed to access it.
 //
@@ -78,42 +78,48 @@
 // uncomment it and replace the name and URL of your repository.
 
 // Local repositories (without and with optional group):
+// Note that the local URL to the repository depends on your platform:
+// Unix-like: file:///path/to/rep
+// Windows: file:///c:/svn/proj
 //
-// $config->addRepo​sitory('NameToDispla​y', 'URL to repository (e.g. file:///c:/svn/proj)');
-// $config->addRepo​sitory('NameToDispla​y', 'URL to repository (e.g. file:///c:/svn/proj)', 'group');
+// $config->addRepo​sitory('NameToDispla​y', 'local URL');
+// $config->addRepo​sitory('NameToDispla​y', 'local URL', 'group');
 //
 // Remote repositories (without and with optional group):
+// A remote URL looks like http://domain.tld/path/to/rep
 //
-// $config->addRepo​sitory('NameToDispla​y', 'URL (e.g. http://path/to/rep)', null, 'username', 'password');
-// $config->addRepo​sitory('NameToDispla​y', 'URL (e.g. http://path/to/rep)', 'group', 'username', 'password');
+// $config->addRepo​sitory('NameToDispla​y', 'remote URL', null, 'username', 'password');
+// $config->addRepo​sitory('NameToDispla​y', 'remote URL', 'group', 'username', 'password');
 //
 // Display Part of a repository as if it was a repository.
 //
 // Local repositories (without and with optional group):
 //
-// $config->addRepo​sitorySubpath('NameT​oDisplay', 'URL to repository (e.g. file:///c:/svn/proj)', 'subpath');
-// $config->addRepo​sitorySubpath('NameT​oDisplay', 'URL to repository (e.g. file:///c:/svn/proj)', 'subpath', 'group');
+// $config->addRepo​sitorySubpath('NameT​oDisplay', 'local URL', 'subpath');
+// $config->addRepo​sitorySubpath('NameT​oDisplay', 'local URL', 'subpath', 'group');
 //
 // Remote repositories (without and with optional group):
 //
-// $config->addRepo​sitorySubpath('NameT​oDisplay', 'URL (e.g. http://path/to/rep)', 'subpath', null, 'username', 'password');
-// $config->addRepo​sitorySubpath('NameT​oDisplay', 'URL (e.g. http://path/to/rep)', 'subpath', 'group', 'username', 'password');
+// $config->addRepo​sitorySubpath('NameT​oDisplay', 'remote URL', 'subpath', null, 'username', 'password');
+// $config->addRepo​sitorySubpath('NameT​oDisplay', 'remote URL', 'subpath', 'group', 'username', 'password');
 //
 // To use the parent path method (without and with optional group), uncomment the next line
 // and replace the path with your one. You can call the function several times if you have several parent paths.
-// Note that in this case the path is a filesystem path.
+// Note that in this case the path is a filesystem path and depends on your platform:
+// Unix-like: /path/to/parent
+// Windows: c:\\svn
 //
-// $config->parentP​ath('Path/to/parent (e.g. c:\\svn)');
-// $config->parentP​ath('Path/to/parent (e.g. c:\\svn)', 'group');
+// $config->parentP​ath('filesystem path');
+// $config->parentP​ath('filesystem path', 'group');
 //
 // To exclude a repository from being added by the parentPath method uncomment the next line
 // and replace the path with your one. You can call the function several times if you have several paths to exclude.
 //
-// $config->addExcl​udedPath('Path/to/pa​rent/excludedRep (e.g. c:\\svn\\excludedRep)');
+// $config->addExcl​udedPath('filesystem​ path of excluded rep');
 //
 // To add only a subset of repositories specified by the parent path you can call the function with a pattern.
 //
-// $config->parentP​ath('Path/to/parent (e.g. c:\\svn)', 'group', '/^beginwith/');
+// $config->parentP​ath('filesystem path', 'group', '/^beginwith/');
 
 // }}}

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

[WebSVN commit] svn commit: r1286 - trunk/include dirkthomas Dirk Thomas 2012-07-01 22:29:38 PDT
Messages per page: