No changes between revisions
/WebSVN/changes.txt
1,8 → 1,11
2.1 alpha 1
 
* Many cleanups and optimisations.
* More documentation for *.inc files.
* Removed extraneous bits.
* Changed: many cleanups and optimisations.
* Added: more documentation for *.inc files.
* Removed: extraneous bits.
* New: PHP_Compat usage to allow some new PHP5 functionality and remain
backwards-compatible.
* Changed: line endings now use UNIX-style across the board.
 
CHANGES
 
/WebSVN/include/configclass.inc
497,6 → 497,7
var $flatIndex = true;
var $openTree = false;
var $serverIsWindows = false;
var $phpCompatEnabled = false;
var $cacheResults = false;
var $multiViews = false;
var $useEnscript = false;
524,6 → 525,7
var $outputEnc = "UTF-8"; // Encoding of web page. Now forced to UTF-8
 
var $quote = "'";
var $pathSeparator = ":";
 
var $_repositories;
 
597,12 → 599,28
$this->setInputEncoding("CP$cp", "iso-8859-1");
// On Windows machines, use double quotes around command line parameters
$this->quote = '"';
$this->quote = '"';
// On Windows, semicolon separates path entries in a list rather than colon.
$this->pathSeparator = ";";
}
 
// }}}
 
// {{{ setPHPCompatEnabled
//
// Used for PHP4
 
function setPHPCompatEnabled() {
$this->phpCompatEnabled = true;
}
function isPHPCompatEnabled() {
return $this->phpCompatEnabled;
}
 
// }}}
 
// {{{ Caching
 
// setCachingOn
/WebSVN/include/distconfig.inc
145,6 → 145,7
// Uncomment the default language. If you want English then don't do anything here.
//
// include 'languages/catalan.inc';
// include 'languages/czech.inc';
// include 'languages/danish.inc';
// include 'languages/dutch.inc';
// include 'languages/finnish.inc';
/WebSVN/include/php5compat.inc
2,12 → 2,6
 
if (version_compare(phpversion(), '5.0.0', 'lt')) {
 
# XXX: these includes shouldn't be necessary!
require_once 'include/configclass.inc';
$config = new Config;
require_once 'include/config.inc';
require_once($config->getPHPCompatFile());
 
// Configure necessary functions here
$funcs = array(
'stripos',
16,6 → 10,13
 
// End configuration
 
// JB: PHP_Compat expects to be able to find functions by including
// 'PHP/Compat/Functions/functionname.php', but that hardcoded path
// isn't relative to the standard include path '.' (it's instead relative
// to './include'). So rather than hack PHP_Compat to work, just add
// './include' to our include path.
ini_set("include_path", ini_get("include_path").$config->pathSeparator."./include");
 
foreach ($funcs as $fn) {
if (PHP_Compat::loadFunction($fn) != true)
error_log('Could not load function `'.$fn.'\' as required by PHP Compat.');
/WebSVN/include/setup.inc
30,15 → 30,20
 
// Include the configuration class
require_once 'include/configclass.inc';
require_once 'include/svnlook.inc';
 
// Create the config
$config = new Config;
 
// Set up the default character encodings
if (function_exists('iconv_get_encoding'))
{
$config->setInputEncoding(iconv_get_encoding('input_encoding'));
}
 
// Define the language array
$lang = array();
$langNames = array();
 
// Include a default language file.
require 'languages/english.inc';
 
// Set up locwebsvnhttp
// Note: we will use nothing in MultiViews mode so that the URLs use the root
// directory by default.
50,18 → 55,24
 
$vars['locwebsvnhttp'] = $locwebsvnhttp;
 
// Make sure that the input locale is set up correctly
setlocale(LC_ALL, '');
// Include a default language file (must go before config.inc)
require 'languages/english.inc';
 
// Create the config
$config = new Config;
// Get the user's personalised config (requires the locwebsvnhttp stuff above)
require_once 'config.inc';
 
// Set up the default character encodings
if (function_exists('iconv_get_encoding'))
{
$config->setInputEncoding(iconv_get_encoding('input_encoding'));
// Load PHP_Compat if we're going to use it. This needs to be done after including config.inc (which contains
// the setting) but before svnlook.inc (which requires util.inc, which contains PHP4-incompatible functions)
if ($config->isPHPCompatEnabled()) {
require_once($config->getPHPCompatFile());
require_once 'include/php5compat.inc';
}
 
require_once 'include/svnlook.inc';
 
// Make sure that the input locale is set up correctly
setlocale(LC_ALL, '');
 
// {{{ Content-Type's
// Set up the default content-type extension handling
 
186,7 → 197,24
'.mov' => 'video/quicktime', // QuickTime Video
'.avi' => 'video/msvideo', // Microsoft Windows Video
'.movie' => 'video/x-sgi-movie', // SGI Movieplayer format
'.wrl' => 'x-world/x-vrml' // VRML Worlds
'.wrl' => 'x-world/x-vrml', // VRML Worlds
'.odt' => 'application/vnd.oasis.opendocument.text', // OpenDocument Text
'.ott' => 'application/vnd.oasis.opendocument.text-template', // OpenDocument Text Template
'.ods' => 'application/vnd.oasis.opendocument.spreadsheet', // OpenDocument Spreadsheet
'.ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', // OpenDocument Spreadsheet Template
'.odp' => 'application/vnd.oasis.opendocument.presentation', // OpenDocument Presentation
'.otp' => 'application/vnd.oasis.opendocument.presentation-template', // OpenDocument Presentation Template
'.odg' => 'application/vnd.oasis.opendocument.graphics', // OpenDocument Drawing
'.otg' => 'application/vnd.oasis.opendocument.graphics-template', // OpenDocument Drawing Template
'.odc' => 'application/vnd.oasis.opendocument.chart', // OpenDocument Chart
'.otc' => 'application/vnd.oasis.opendocument.chart-template', // OpenDocument Chart Template
'.odf' => 'application/vnd.oasis.opendocument.formula', // OpenDocument Formula
'.otf' => 'application/vnd.oasis.opendocument.formula-template', // OpenDocument Formula Template
'.odi' => 'application/vnd.oasis.opendocument.image', // OpenDocument Image
'.oti' => 'application/vnd.oasis.opendocument.image-template', // OpenDocument Image Template
'.odm' => 'application/vnd.oasis.opendocument.text-master', // OpenDocument Master Document
'.oth' => 'application/vnd.oasis.opendocument.text-web', // HTML Document Template
'.odb' => 'application/vnd.oasis.opendocument.database', // OpenDocument Database
 
);
 
273,10 → 301,6
 
$zipped = array ();
 
// Get the user's personalised config
 
require_once 'config.inc';
 
// Set up the version info
 
initSvnVersion($major,$minor);
/WebSVN/include/svnlook.inc
-
if ( function_exists("mb_detect_encoding") && function_exists("mb_convert_encoding"))
{
$parts[$i] = mb_convert_encoding($parts[$i], "UTF-8", mb_detect_encoding($parts[$i]));
/WebSVN/include/utils.inc
24,8 → 24,6
//
// General utility commands
 
#require_once 'php5compat.inc';
 
// {{{ createDirLinks
//
// Create a list of links to the current path that'll be available from the template
153,11 → 151,68
 
function hardspace($s)
{
return '<code>'.$s.'</code>';
return '<code>' . expandTabs($s) . '</code>';
}
 
// }}}
 
// {{{ expandTabs
 
/**
* Expands the tabs in a line that may or may not include HTML.
*
* Enscript generates code with HTML, so we need to take that into account.
*
* @param string $s Line of possibly HTML-encoded text to expand
* @param int $tabwidth Tab width, -1 to use repository's default, 0 to collapse
* all tabs.
* @return string The expanded line.
* @since 2.1
*/
 
function expandTabs($s, $tabwidth = -1)
{
global $rep;
 
if ($tabwidth == -1)
$tabwidth = $rep->getExpandTabsBy();
$pos = 0;
 
// Parse the string into chunks that are either 1 of: HTML tag, tab char, run of any other stuff
$chunks = preg_split("/((?:<.+?>)|(?:&.+?;)|(?:\t))/", $s, -1, PREG_SPLIT_DELIM_CAPTURE);
 
// Count the sizes of the chunks and replace tabs as we go
for ($i = 0; $i < count($chunks); $i++)
{
# make sure we're not dealing with an empty string
if (empty($chunks[$i])) continue;
switch ($chunks[$i]{0})
{
case '<': // HTML tag : ignore its width by doing nothing
break;
 
case '&': // HTML entity: count its width as 1 char
$pos += 1;
break;
 
case "\t": // Tab char: replace it with a run of spaces between length tabwidth and 1
$tabsize = $tabwidth - ($pos % $tabwidth);
$chunks[$i] = str_repeat(' ', $tabsize);
$pos += $tabsize;
break;
 
default: // Anything else: just keep track of its width
$pos += strlen($chunks[$i]);
break;
}
}
 
// Put the chunks back together and we've got the original line, detabbed.
return join('', $chunks);
}
 
// }}}
 
// {{{ datetimeFormatDuration
//
// Formats a duration of seconds for display.
227,6 → 282,8
 
function getParameterisedSelfUrl($params = true)
{
global $config;
 
$url = null;
 
if ($config->multiViews)
256,4 → 313,28
 
// }}}
 
// {{{ getUserLanguage
 
function getUserLanguage() {
$languages = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : 'en';
if (strpos($languages, ',') === false) return $languages; # only one specified
# split off the languages into an array of languages and q-values
$qvals = array();
$langs = array();
preg_match_all('#(\S+?)\s*(?:;q=([01](?:\.\d{1,3})?))?\s*,\s*#', $languages, $qvals, PREG_SET_ORDER);
foreach ($qvals as $q) {
$langs[] = array (
$q[1],
floatval(!empty($q[2]) ? $q[2] : 1.0)
);
}
# XXX: now, we should loop through our available languages and choose an
# appropriate one for the user
# note that we shouldn't match the region unless we have a specific region
# to use (e.g. zh-CN vs. zh-TW)
# FIXME: see above; otherwise, this function doesn't really do anything
}
 
// }}}
 
?>
/WebSVN/index.php
74,6 → 74,7
$url = $config->getURL($project, "/", "dir");
if ($curgroup != $project->group)
{
# TODO: this should be de-soupified
if (!empty($curgroup))
$listing[$i]["listitem"] = "</div>\n"; // Close the switchcontent div
else
/WebSVN/languages/NotUsed/catalan.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Català-Valencià";
$lang['LANGUAGETAG'] = 'ca';
 
$lang["LOG"] = "Registre";
$lang["DIFF"] = "Diferència";
83,6 → 84,7
$lang["MORERESULTS"] = "Cerca més coincidències...";
$lang["NORESULTS"] = "No hi ha cap registre que coincideixi amb la vostra cerca";
$lang["NOMORERESULTS"] = "No hi ha més registres que coincideixin amb la vostra cerca";
$lang['NOPREVREV'] = 'No hi ha cap revisió anterior.';
 
$lang["RSSFEEDTITLE"] = "Canal RSS del WebSVN";
$lang["FILESMODIFIED"] = "fitxer(s) modificat(s)";
/WebSVN/languages/NotUsed/danish.inc
26,6 → 26,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Dansk";
$lang['LANGUAGETAG'] = 'da';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Sammenlign";
/WebSVN/languages/NotUsed/dutch.inc
28,6 → 28,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Dutch";
$lang['LANGUAGETAG'] = 'nl';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/finnish.inc
26,6 → 26,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Finnish";
$lang['LANGUAGETAG'] = 'fi';
 
$lang["LOG"] = "Loki";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/french.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Francais";
$lang['LANGUAGETAG'] = 'fr';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/german.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "German";
$lang['LANGUAGETAG'] = 'de';
 
$lang["DIFF"] = "Diff";
 
/WebSVN/languages/NotUsed/japanese.inc
26,6 → 26,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Japanese";
$lang['LANGUAGETAG'] = 'ja';
 
$lang["LOG"] = "ログ";
$lang["DIFF"] = "差分";
/WebSVN/languages/NotUsed/korean.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Korean";
$lang['LANGUAGETAG'] = 'ko';
 
$lang["LOG"] = "로그";
$lang["DIFF"] = "비교";
/WebSVN/languages/NotUsed/norwegian.inc
31,6 → 31,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Norwegian";
$lang['LANGUAGETAG'] = 'no';
 
$lang["LOG"] = "Logg";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/polish.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Polish";
$lang['LANGUAGETAG'] = 'pl';
 
$lang["LOG"] = "Dziennik zmian";
$lang["DIFF"] = "Różnice";
/WebSVN/languages/NotUsed/portuguese.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Portuguese";
$lang['LANGUAGETAG'] = 'pt';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/russian.inc
27,6 → 27,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Russian";
$lang['LANGUAGETAG'] = 'ru';
 
$lang["LOG"] = "Журнал";
$lang["DIFF"] = "Различия";
/WebSVN/languages/NotUsed/schinese.inc
27,6 → 27,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Simplified Chinese";
$lang['LANGUAGETAG'] = 'zh-CN';
 
$lang["LOG"] = "记录";
$lang["DIFF"] = "差异";
/WebSVN/languages/NotUsed/slovenian.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Slovenian";
$lang['LANGUAGETAG'] = 'sl';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/spanish.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Spanish";
$lang['LANGUAGETAG'] = 'es';
 
$lang["LOG"] = "Log";
$lang["DIFF"] = "Diff";
/WebSVN/languages/NotUsed/swedish.inc
25,6 → 25,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Swedish";
$lang['LANGUAGETAG'] = 'sv';
 
$lang["LOG"] = "Logg";
$lang["DIFF"] = "Skillnad";
/WebSVN/languages/NotUsed/tchinese.inc
27,6 → 27,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Traditional Chinese";
$lang['LANGUAGETAG'] = 'zh-TW';
 
$lang["LOG"] = "歷史記錄";
$lang["DIFF"] = "比對";
/WebSVN/languages/NotUsed/turkish.inc
26,6 → 26,7
 
// The language name is displayed in the drop down box. It MUST be encoded as Unicode (no HTML entities).
$lang["LANGUAGENAME"] = "Turkish";
$lang['LANGUAGETAG'] = 'tr';
 
$lang["LOG"] = "Kayıt";
$lang["DIFF"] = "Fark";
/WebSVN/languages/english.inc
86,6 → 86,7
$lang["MORERESULTS"] = "Find more matches...";
$lang["NORESULTS"] = "There are no logs matching your query";
$lang["NOMORERESULTS"] = "There are no more logs matching your query";
$lang['NOPREVREV'] = 'No previous revision';
 
$lang["RSSFEEDTITLE"] = "WebSVN RSS feed";
$lang["FILESMODIFIED"] = "file(s) modified";
/WebSVN/listing.php
51,7 → 51,6
$pfile = substr($file, 1);
else
$pfile = $file;
//$pfile = rawurldecode($pfile);
 
if ($returnjoin)
return $ppath.$pfile;
372,9 → 371,9
 
if (isset($history->entries[1]->rev))
{
$vars["curdircomplink"] = "<a href=\"${compurl}compare%5B%5D=".
$vars["curdircomplink"] = "<a href=\"${compurl}compare[]=".
urlencode($history->entries[1]->path)."@".$history->entries[1]->rev.
"&amp;compare%5B%5D=".urlencode($history->entries[0]->path)."@".$history->entries[0]->rev.
"&amp;compare[]=".urlencode($history->entries[0]->path)."@".$history->entries[0]->rev.
"\">${lang["DIFFPREV"]}</a>";
}
else
/WebSVN/log.php
248,7 → 248,7
if (!$numSearchResults)
{
$url = $config->getURL($rep, $path, "log");
$vars["logsearch_moreresultslink"] = "<a href=\"${url}rev=$rev&amp;&sc=$showchanged&amp;isdir=$isDir&logsearch=1&search=$search&fr=$thisrev\">${lang["MORERESULTS"]}</a>";
$vars["logsearch_moreresultslink"] = "<a href=\"${url}rev=$rev&amp;sc=$showchanged&amp;isdir=$isDir&amp;logsearch=1&amp;search=$search&amp;fr=$thisrev\">${lang["MORERESULTS"]}</a>";
break;
}
}
/WebSVN/templates/BlueGrey/diff.tmpl
2,7 → 2,7
[lang:NOACCESS]
[websvn-else]
[websvn-test:noprev]
No Previous Revision
[lang:NOPREVREV]
[websvn-else]
<table cellspacing="0" cellpadding="0" border="0" width="100%">
/WebSVN/templates/MLAB/header.tmpl
39,7 → 39,7
<link rel="alternate" type="application/rss+xml" title="WebSVN RSS" href="[websvn:curdirrsshref]">
[websvn-endtest]
</head>
<body lang="[lang:LANG]">
<body lang="[lang:LANGUAGETAG]">
<!-- AUTOINCLUDE START "Page/Header.cs.ihtml" DO NOT REMOVE -->
<!-- ============== HLAVIČKA ============== -->
<div class="Header">
/WebSVN/templates/Standard/diff.tmpl
2,7 → 2,7
[lang:NOACCESS]
[websvn-else]
[websvn-test:noprev]
No Previous Revision
[lang:NOPREVREV]
[websvn-else]
<div align="right">[websvn:projects_form][websvn:projects_select][websvn:projects_submit][websvn:projects_endform]</div>
<h2>[websvn:repname]</h2>
/WebSVN/templates/StandardNG/diff.tmpl
1,5 → 1,5
[websvn-test:noprev]
No Previous Revision
[lang:NOPREVREV]
[websvn-else]
<div align="right">[websvn:projects_form][websvn:projects_select][websvn:projects_submit][websvn:projects_endform]</div>
<h2>[websvn:repname]</h2>
/WebSVN/templates/Zinn/diff.tmpl
2,7 → 2,7
[lang:NOACCESS]
[websvn-else]
[websvn-test:noprev]
No Previous Revision
[lang:NOPREVREV]
[websvn-else]
<table width="100%" border="0">
<tr>
/WebSVN/wsvn.php
37,7 → 37,7
 
// Physical location of websvn directory
#$locwebsvnreal = "d:/websvn";
$locwebsvnreal = '/home/junx/docs/wsvn';
$locwebsvnreal = '/mnt/wsvn';
 
chdir($locwebsvnreal);