Inhaltsverzeichnis

Dokuwiki Tips

Updating Dokuwiki

Consider the recommended approach which overwrites the old installation instead of the manual here!

This manual presumes that you saved a copy of the original config files with the extension .sborg before you made any changes!

  1. Download and extract newest Dokuwiki version on the server. Use Stable (direct link, not customized) from http://download.dokuwiki.org
  2. Locate all files with the extension .dist (eg conf/local.php.dist) in the new dokuwiki installation and copy their counterparts without the .dist extension (eg conf/local.php) to the new dokuwiki installation.
    Note that it might be necessary to treat .htaccess manually!
  3. Copy additional Interwiki Shortcut images to lib/images/interwiki
  4. Copy additional smiley images to lib/images/smileys
  5. chmod a-rwx install.php. Do not run it!
  6. Set owner and group of newDokuwiki/ recursively to root:root
  7. Set owner and group of newDokuwiki/conf, newDokuwiki/data and newDokuwiki/lib recursively to the ID of your webserver eg. apache:apache. Optionally finetune permissinons
  8. delete unnecessary language translations with bin/striplangs.php
  9. Download and install fresh revisions of previously installed additional plugins from the web
  10. Make a list of all files with the extension .sborg (eg. old/conf/acronyms.conf.sborg) in the old dokuwiki installation. Then go to the new dokuwiki installation and copy the corresponding original files to <file>.sborg (eg. cp new/conf/acronyms.conf new/conf/acronyms.conf.sborg)
  11. In the new dokuwiki installation patch <file> with the modifications: merge <file> old/<file>.sborg old/<file>. Do this for all files on the list where the old changes are still really necessary for the new wiki version.
  12. copy data:
    cp -a oldDokuwiki/data/attic/* newDokuwiki/data/attic
    cp -a oldDokuwiki/data/pages/* newDokuwiki/data/pages
    cp -a oldDokuwiki/data/media/* newDokuwiki/data/media
    cp -a oldDokuwiki/data/meta/*  newDokuwiki/data/meta
  13. Restore the content of the namespaces wiki and playground from the newDokuwiki
  14. Update index with bin/indexer.php. See cli#indexerphp

Note: After update to 2014-09-29d „Hrun“ the toolbar icons were missing in the edit page. Try:

  1. Admin → Configuration Settings → cssdatauri from 0 to 500.

See also Upgrading Configuration Files with a three-way File Merge & http://www.dokuwiki.org/install:diffupgrade

Add an Interwiki Shortcut

  1. Add URL in dokuwiki/conf/interwiki.conf
  2. Add the interwiki icon at dokuwiki/lib/images/interwiki. Possible formats: .gif and .png, but not .ico (Tested with version 2007-06-26b)
  3. Delete the cache: rm -rf dokuwiki/data/cache/*
  4. Reload the page in browser

See also http://www.dokuwiki.org/interwiki

Enable Linebreaks

Install plugin:xbr plugin and set renderer_xhtml to xbr in Configuration Settings

URL Rewriting

Uncomment

LoadModule rewrite_module lib/httpd/modules/mod_rewrite.so

in /etc/apache/httpd.conf

Make sure that .htaccess file is respected with

<Directory /path/to/dokuwiki>
  AllowOverride All
</Directory>

or

<Directory /var/www/htdocs>
  AllowOverride All
</Directory>

in /etc/apache/httpd.conf

Uncomment everything beginning with #Rewrite… in /var/www/htdocs/dokuwiki/.htaccess, but not the line #RewriteBase /dokuwiki.

Enable rewriting in admin config menu by setting it to type 1

See also: wiki:rewrite

How the Search Index works

This section is just informative for interested people. Indexing works automatically, no configuration has to be done.

The search index is saved in dokuwiki/data/index/.

Example:

Attic

Updating Dokuwiki with git

This is still experimental!

Info source

Download repository with:

git clone git://github.com/splitbrain/dokuwiki.git # or behind a firewall:
git clone http://github.com/splitbrain/dokuwiki.git

Look for the stable branch in the remote repo which you will use as base:

git branch -r

And copy it into a local branch:

git checkout -b stable origin/stable

Create a private branch for your modifications:

git checkout -b mysettings stable
(make your changes)
git commit -a -m '...'

Now you can pull all needed updates whenever a new release comes out:

git checkout stable
git pull
git checkout mysettings
git merge stable

See also branches

You could also directly work on branch stable instead of creating mysettings. But this seems not to be idiomatic git usage.

monospaced in blue

lib/tpl/default/design.css — 2007-01-06 17:16

diff design.css.org design.css

465a466
>   color: darkblue;

Update Manual

Infos from wiki:install:upgrade

General Update strategy:

Update in detail:

Update Log

Config Log

Always conserve the original file before any changes! Eg. cp print.css print.css.org

Bash Syntax Highlighting

Comments wasn't recognized as comments. Removed inc/geshi/bash.php of version 2006-11-06 with that of old version 2006-03-09

URL Rewriting

Uncomment everithing beginning with #Rewrite… in ~/www/dokuwiki/.htaccess. But not the line #RewriteBase /dokuwiki. See wiki:rewrite

Normal text left, not justified

lib/tpl/default/print.css line 65 — 2006-08-18

diff print.css.org print.css

65c65
<   text-align: justify;
---
>   text-align: left;

monospaced in blue

lib/tpl/default/design.css — 2007-01-06 17:16

diff design.css.org design.css

465a466
>   color: darkblue;

To Do

Old

Installation and Upgrade

Installation

At date? version 2005-07-13 installed

Upgrade to 2005-09-22

At 2005-09-29 20:53
Infos from wiki:install - > upgrading

At the server:
wget http://www.splitbrain.org/Programming/PHP/DokuWiki/dokuwiki-2005-09-22.tgz tar -xzf dokuwiki-2005-09-22.tgz
mv dokuwiki dokuwiki.2.bak
mv dokuwiki-2005-09-22 dokuwiki
dokuwiki/data > touch changes.log
cp -r dokuwiki.2.bak/data/pages/* dokuwiki/data/pages/
cp -r dokuwiki.2.bak/data/media/* dokuwiki/data/media/
dokuwiki.2.bak/conf > cp -v acl.auth.php local.php users.auth.php ~/www.think-deep.com/dokuwiki/conf/

In inc/lang all dirs but en/ es/ & de/ deleted

Changes at the Sourcecode

Enabling Line Breaks

FIXME This is not done yet!

inc/parser/handler.php

The following code in function process($calls) of class Doku_Handler_Block

if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) {
//...
}else{
    //if this is just a single eol make a space from it
    $this->calls[] = array('cdata',array(" "), $call[2]);
}

replaced with:

if ( isset($calls[$key+1]) && $calls[$key+1][0] == 'eol' ) {
//...
}else{
    $dobreak= true; // debugging
    if ($dobreak && isset($calls[$key-1])
            && ($calls[$key-1][0] != 'eol')
            && ($calls[$key-1][0] != 'linebreak') ){
        $this->calls[] = array('linebreak',array(), $call[2]);
    } else {
        $this->calls[] = array('cdata',array(" "), $call[2]);
    }
}

deduced from wiki:discussion:nonewline

inc/lang/en/edit.txt

All Line breaks removed from that file because those breaks would also be displayed when edition a wiki page

lib/tpl/default/design.css

In order to get line breaks also in indented areas:
Source: http://wiki.splitbrain.org/wiki:tips:prewithwrap

/* code block by code tag */
pre.code {
  /* ..*/
  /* becki added  source: http://wiki.splitbrain.org/wiki:tips:prewithwrap */
  white-space: pre-wrap;       /* css-3 */
  white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
  white-space: -pre-wrap;      /* Opera 4-6 */
  white-space: -o-pre-wrap;    /* Opera 7 */
  word-wrap: break-word;       /* Internet Explorer 5.5+ */
}

Changes at Configuration Files

.htaccess

Commented in for nice URL's:

RewriteEngine on
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php
conf/local.php
$conf['title']       = 'Beckis Own Wiki';  //what to show in the title
$conf['useacl']      = 1;      //Use Access Control Lists to restrict access?
$conf['openregister']= 1;      //Should users to be allowed to register?
$conf['autopasswd']  = 0;      //autogenerate passwords and email them to user
$conf['superuser']   = 'admin';
$conf['htmlok']      = 1;

2006-02-06 10:24 :

$conf['dformat']     = 'Y-m-d H:i'; //dateformat accepted by PHPs date() function
$conf['signature']   = ' --- [[@MAIL@|@USER@]] @DATE@'; //signature see wiki:config for details

2006-03-02 for nice URL's:

$conf['userewrite']  = 1;  //this makes nice URLs: 0:off 1:.htaccess 2:internal
conf/interwiki.conf

Shortcut for Php manual:

  1. becki added

phpman http://de.php.net/manual/en/{NAME}.php

lib/images/interwiki/

Icon for shortcut for Php manual:
favicon from php.net fetched, converted to gif with convert & uploaded