From: Steve W. <sw...@pa...> - 2000-10-06 21:10:42
|
This patch sounds like a good idea: no default server name. Another "why didn't I think of that?" idea. Anybody see any holes in it? sw http://wcsb.org/~swain/ | "In a calendar year, America's entire * * * * * * | recorded music industry has revenues * * * * * * | roughly equal to one month's sales by * * * * * * | IBM." --Philip Greenspun ---------- Forwarded message ---------- Date: Fri, 6 Oct 2000 14:16:52 +1100 (EST) From: Neil Brown <ne...@cs...> To: Steve Wainstead <Wai...@us...> Subject: phpwiki - I like it. hi, I was introduced to phpwiki recently through http://kernelbook.sourceforge.net/wiki/KernelWiki and I like it. I tried building something vaguely similar a while back, but made the mistake of over designing, and it never quite got off the ground. phpwiki looks like a much better starting point. I have been playing with if for all of a day and a half now and have a few changes I would like to suggest. So, you can expect to received a few patches in the mail from me. I hope that's ok. My first patch addresses the setting of ServerAddress. I have found that the best value for ServerAddress (for me) is an empty string. This causes relative URI's to appear in the html which browsers cope with quite well. I need this because I am running it from a web server on my note book (for testing) and often I don't have an internet address and haveto use localhost. But if I set ServerAddress to be localhost, then when I am plugged in, I cannot access the pages from else where. This should work out-of-the-box for everybody. I cannot think of a case when specifing a server address is needed, but there might be one. The following patch makes empty string the default, but still leave the other possibilities as options. I also needed to removed ServerAddress from SignatureImg (in line wit $logo) so that it is used as a relative URI too. NeilBrown --- ./wiki_config.php3 2000/10/06 02:21:24 1.1 +++ ./wiki_config.php3 2000/10/06 02:23:24 1.2 @@ -13,19 +13,21 @@ can just give the URL without the script name. */ - // You should set the $ServerAddress below, and comment out - // the if/else that follows. The if/else sets the server address - // dynamically, and you can save some cycles on the server by - // setting $ServerAddress yourself. + // An empty server address: + $ServerAddress = ""; + // works quite well thanks to relative URIs. If find that you + // want an explicit address, you can set one yourself by changing + // and uncommenting: //$ServerAddress = "http://127.0.0.1:8080/phpwiki/"; - - + // Or you could use the if/else statement below to deduce + // the $ServerAddress dynamically. + /* if (preg_match("#(.*?)([^/]*$)#", $REQUEST_URI, $matches)) { $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT" . $matches[1]; } else { $ServerAddress = "http://$SERVER_NAME:$SERVER_PORT$REQUEST_URI"; } - + */ // if you are using MySQL instead of a DBM to store your // Wiki pages, use wiki_mysql.php3 instead of wiki_dbmlib.php3 // See INSTALL.mysql for details on using MySQL @@ -138,7 +140,7 @@ "MESSAGE" => "templates/message.html" ); - $SignatureImg = "$ServerAddress/signature.png"; + $SignatureImg = "signature.png"; $logo = "wikibase.png"; // date & time formats used to display modification times, etc. |