[pmwiki-devel] Directory structure revisited
thp at sigproc.de
thp at sigproc.de
Sun Nov 12 00:01:20 CST 2006
Hello,
thanks for the config details.
Though pmwiki seems to be configurable to achieve the separation between
php executables and accessible data(*), I had to find out that the idea is
still not realizable due to the semantics of php's open_basedir variable:
The open_basedir restriction is also in effect when _including_ a file.
This means that (sticking to my example layout) scripts below docroot/ can
NOT be included. This is (expectedly) also true when adding the path to
safe_mode_include_dir. Extending the open_basedir variable to the scripts
path on the other hand would just destroy the separation that we aimed for,
so its not a viable option.
Thomas
(*) Some minor change in scripts/skin.php (around line 46) was necessary:
foreach((array)$skin as $s) {
$sd = FmtPageName("$BaseDir/pub/skins/$s", $pagename);
// instead of "./pub/skins/$s"
if (is_dir($sd))
{ $Skin=$s; $SkinDirUrl="$PubDirUrl/skins/$Skin"; break; }
Also, i18n did not yet work.
At 07:30 09.11.2006 -0600, you wrote:
>On Thu, Nov 09, 2006 at 10:37:24AM +0100, thp at sigproc.de wrote:
>> Pm wrote:
>> >
>> >In short, if you describe the directory structure you want to have,
>> >we can probably come up with the local configuration settings to
>> >make it happen. :-)
>>
>> Here the directory structure that I had in mind (still incomplete, see
below):
>>
>> .../myhome/
>> docRoot/ (served by webserver to extern,
non-wrtble)
>> myPmWiki/
>> pmwiki.php
>> scripts/
>> pub/ ?
>> etc.
>> scriptAccessibleFileSpace/ (accessible for scripts on file access)
>> myPmWiki/
>> upload/
>> wiki.d/
>> pub/ ?
>> [...]
>> DocumentRoot .../myhome/docRoot/
>> php_admin_value open_basedir .../myhome/scriptAccessibleFileSpace/
>
>We would also need to put wikilib.d/ into scriptAccessibleFileSpace/ .
>With that in mind, here are the PmWiki settings to put all of the
>accessed files into .../myhome/scriptAccessibleFileSpace:
>
> $BaseDir = '.../myhome/scriptAccessibleFileSpace';
>
> $WikiDir = new PageStore("$BaseDir/wiki.d/{\$FullName}");
> $WikiLibDirs = array(&$WikiDir,
> new PageStore("$BaseDir/wikilib.d/{\$FullName}"));
> $WorkDir = "$BaseDir/wiki.d";
>
> $UploadDirFmt = "$BaseDir/uploads";
>
> $PageCSSListFmt = array(
> "$BaseDir/pub/css/local.css" => '$PubDirUrl/css/local.css',
> "$BaseDir/pub/css/{$Group}.css" => '$PubDirUrl/pub/css/{$Group}.css',
> "$BaseDir/pub/css/{$FullName}.css" =>
> '$PubDirUrl/pub/css/{$FullName}.css'));
> $SkinLibDirs = array(
> "$BaseDir/pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin");
>
>Pm
>
More information about the pmwiki-devel
mailing list