[pmwiki-users] Dealing with $ScriptUrl using a "local" path (Was: Wikipublisher..)

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Thu Dec 21 05:36:35 CST 2006


Hi John (and Patrick)

I'm sending this to Patrick as well as the list I think the solution 
concerns PmWiki and possibly recipes in general.

On Thu, 21 Dec 2006, christian.ridderstrom at gmail.com wrote:

> I'm trying to install wiki publisher, but when trying to typeset a single 
> page I run into problems:
>
> Clicking download results in this link:
>
> http://www.wikipublisher.org/cgi-bin/mkpdf.pl//~chr/test/pmwiki.php?a<snip>
 						|
 						`-- stuff missing!

I found the culprit. Wikipublisher uses $ScriptUrl for the URI to the 
pdfserver (at wikipublisher.org). Since I had set $ScriptUrl like this:

 	$ScriptUrl = '/~chr/test/pmwiki.php';

the pdfserver has no idea from where I am coming. the quick fix is this:

 	$ScriptUrl = 'http://wiki.lyx.org/~chr/test/pmwiki.php';

However, I think I should be able to use a "local" $ScriptUrl?  (Patrick, 
could you let me know if this is a bad idea in general. The reason I 
started using it was that one of the LyX developers recommended it).

So how to get a recipe in general to know an "external" path to the 
script?

Here are some solutions I can think of:

* Introduce a function that is guaranteed to return a URI to the script
   that is "full", i.e. starts with 'http' or 'https'.
** This function could possibly also guarantee to return the URI of the
    actual script. That might be useful for people that use clean URIs.
    IIRC, some recieps have problems with clean URIs because they really
    need the URI of pmwiki.php.

* Introduce a variable like $ScriptUrlExt or $ScriptUrlFull that is
   guaranteed to start with 'http://' or 'https://' that recipes can use.

* Assume that recipes must check $ScriptUrl to see if it starts with
   'http'.

Maybe the solution to this problem can be combined with dealing with the 
difference between 'http:' and 'https:'?  I'm sure there are other recipes 
that could benefit from a method to generate a suitable (full) URI.

regards
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list