Le jeudi 08 juillet 2010, Balaji Dutt a écrit :
> 1. Purged dokuwiki from the system using "aptitude purge" and then manually
> removed the /etc,/var/lib and /usr/share directories for files added by me.
> 
> 2. Installed 0.0.20091225c-4 - There were some errors during this process,
> see the install-output.log attached.

This is because you manually deleted the /etc/dokuwiki/htaccess config
file. If it was not deleted by the purge, then it is a bug I do not
understand in my postrm script.

> 3. Copied back my customized users.auth.php and acl.auth.php.
> 
> 4. Logged into the admin area and navigated to the ACL page. Clicking on a
> namespace still triggers the "Warning:
> require_once(/var/lib/dokuwiki/plugins/acl/../../../inc/init.php)" message.

This is from lib/plugins/acl/ajax.php.

> 5. I hacked the /var/lib/dokuwiki/plugins/acl/admin.php to include a
> one-liner "echo DOKU_INC;' - see the screengrab attached. Despite the
> "headers already sent errors", you can see that the DOKU_INC variable is
> pointing to /usr/share/dokuwiki

Yes, as admin.php is run through DokuWiki's main scripts, that define
DOKU_INC correctly.

> Tangentially related - The use of the php_value command inside
> /etc/dokuwiki/apache.conf does not work for apache2-mpm-worker/php5-cgi
> environment. It would be nice if the installer could detect this and switch
> to using a php.ini directive instead.

This is not tangentially related: it is completely related, and the
cause of your problem. DokuWiki plugins are usually run through
DokuWiki's main scripts that define DOKU_INC correctly.

However, some include parts that are directly called from the web: the
acl plugin does so, with its ajax.php. In such a case, they have no way
to get the DOKU_INC variable, so they try setting it to ../../../.
This works on standard, manual installations. But with the Debian
package, as there are parts that the user wants to change (plugins,
templates) and parts that should only be managed by the package manager,
I had to split the installation. That is why plugins are now under
/var/lib, and will not find the inc/ directory at ../../../inc.

This is problematic with plugins that have standalone scripts. To solve
that I used a php_value command to define DOKU_INC, but that does not
work with a php5-cgi setup, indeed.

So I think I have two options:
1. replicate all the DokuWiki file hierarchy under /var/lib: this is
   delicate, as it would require yet another disruptive change, and a
   transition to manage, possibly causing new problems;
2. patch the built-in plugins to define DOKU_INC inside them, and leave
   the few third-party plugins that use standalone scripts not working,
   documenting in README.Debian how to patch them.

Now let me think about the best solution…

-- 
Tanguy Ortolo

Attachment: signature.asc
Description: Digital signature

Reply via email to