jablonka.czprosek.czf

websvn

Subversion Repositories:
[/] [wsvn.php] - Blame information for rev 3

 

Line No. Rev Author Line
11simandl<?php
2// WebSVN - Subversion repository viewing via the web using PHP
3// Copyright (C) 2004-2006 Tim Armes
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program; if not, write to the Free Software
17// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18//
19// --
20//
21// wsvn.php
22//
23// Glue for MultiViews
24 
25// --- CONFIGURE THIS VARIABLE ---
26 
27// Location of websvn directory via HTTP
28//
293simandl// e.g. For "http://www.example.com/websvn" use "/websvn"
301simandl//
31// Note that wsvn.php need not be in the /websvn directory (and normally isn't).
32// If you want to use the root server directory, just use a blank string ('').
33//$locwebsvnhttp = "/websvn";
34$locwebsvnhttp = '';
35 
363simandl// Physical location of websvn directory. Change this if your wsvn.php is not in
37// the same folder as the rest of the distribution
381simandl$locwebsvnreal = dirname(__FILE__);
39 
40// --- DON'T CHANGE BELOW HERE ---
41 
42chdir($locwebsvnreal);
43 
443simandl// Tell files that we are using multiviews if they are unable to access $config.
451simandlif (!defined('WSVN_MULTIVIEWS')) {
46 define('WSVN_MULTIVIEWS', 1);
47}
48 
49ini_set("include_path", $locwebsvnreal);
50 
51require_once("include/setup.php");
52require_once("include/svnlook.php");
53 
54if (!isset($_REQUEST["sc"])) {
55 $_REQUEST["sc"] = 1;
56}
57 
58if ($config->multiViews) {
59 // If this is a form handling request, deal with it
60 if (@$_REQUEST["op"] == "form") {
61 include("$locwebsvnreal/form.php");
62 exit;
63 }
64 
65 $origPathInfo = isset($_SERVER['ORIG_PATH_INFO']) ? $_SERVER['ORIG_PATH_INFO'] : '';
66 $pathInfo = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
67 $path = trim(empty($pathInfo) ? $origPathInfo : $pathInfo);
68 
69 // Remove initial slash
70 $path = substr($path, 1);
71 if (empty($path)) {
72 include("$locwebsvnreal/index.php");
73 exit;
74 }
75 
76 // Split the path into repository and path elements
77 // Note: we have to cope with the repository name
78 // having a slash in it
79 
80 $pos = strpos($path, '/');
81 if ($pos === false) {
82 $pos = strlen($path);
83 }
84 $name = substr($path, 0, $pos);
85 
863simandl $rep =& $config->findRepository($name);
87 if ($rep != null) {
88 $path = substr($path, $pos);
89 if ($path == '') {
90 $path = '/';
911simandl }
923simandl } else {
931simandl include("$locwebsvnreal/index.php");
94 exit;
95 }
96 
97 createProjectSelectionForm();
98 createRevisionSelectionForm();
99 $vars["allowdownload"] = $rep->getAllowDownload();
1003simandl $vars["repname"] = htmlentities($rep->getDisplayName(), ENT_QUOTES, 'UTF-8');
1011simandl 
102 // find the operation type
103 $op = @$_REQUEST["op"];
104 switch ($op) {
105 case "dir":
106 $file = "listing.php";
107 break;
108 case "revision":
109 $file = "revision.php";
110 break;
111 case "file":
112 $file = "filedetails.php";
113 break;
114 case "log":
115 $file = "log.php";
116 break;
117 case "diff":
118 $file = "diff.php";
119 break;
120 case "blame":
121 $file = "blame.php";
122 break;
123 case "rss":
124 $file = "rss.php";
125 break;
126 case "dl":
127 $file = "dl.php";
128 break;
129 case "comp":
130 $file = "comp.php";
131 break;
132 default:
1333simandl $svnrep = new SVNRepository($rep);
134 if ($svnrep->isFile($path, $rev)) {
1351simandl $file = "filedetails.php";
1363simandl } else {
137 $file = "listing.php";
1381simandl }
139 break;
140 }
141 
142 // Now include the file that handles it
143 include("$locwebsvnreal/$file");
144 
145} else {
146 print "<p>MultiViews must be configured in config.php in order to use this file";
147 exit;
148}

Powered by WebSVN 2.2.1