DiffKeepDays

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Question

How do I change the number of days a page's revision history is kept?

Answer

The $DiffKeepDays variable sets the minimum length of time that a page's revision history is kept. By default it is set to 3650 days, or a little less than ten years. You can change this value in a customization file to be something smaller, e.g.:

    $DiffKeepDays = 30;          # keep revisions at least 30 days

Note that a specific page revision isn't removed from the page until the first edit after the time specified by $DiffKeepDays has elapsed. Thus, it's still possible for some pages to have revisions older than $DiffKeepDays -- such revisions will be removed the next time those pages are edited.

Contributors

  • Pm, 3-Mar-2004

pmwiki-2.5.9 -- Last modified by {{Pm}}

from IP: 85.171.160.186 ip should be disabled by default for security reasons

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2dV1%2fDiffKeepDays
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2dV1%2fDiffKeepDays
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/DiffKeepDays
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook-V1/DiffKeepDays
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afR-8BXtstGV3g10P6yO8gAAAUI
            [REDIRECT_URL] => /wiki/Cookbook-V1/DiffKeepDays
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 8345
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook-V1/DiffKeepDays
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook-V1/DiffKeepDays
            [SCRIPT_URL] => /wiki/Cookbook-V1/DiffKeepDays
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afR-8BXtstGV3g10P6yO8gAAAUI
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777630960.7673
            [REQUEST_TIME] => 1777630960
            [argv] => Array
                (
                    [0] => n=Cookbook%2dV1%2fDiffKeepDays
                )

            [argc] => 1
        )

)