ewiki configuration constants and variables
===========================================
README.config
ŻŻŻŻŻŻŻŻŻŻŻŻŻ
In this part of the documentation the core configuration settings/constants
will be described. There is a long list of EWIKI_ constants and a smaller
fraction of setup variables in the $ewiki_config[] array, which can tweak
behaviour.
Some other run-time variables are described in the [README.programming],
which also talks about other internals.
-------------------------------------------------------------------- 3 --
EWIKI_ constants
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
This chapter explains some of the constants and how you can utilize
them to tweak some of ewiki's behaviour.
The recommended way to change settings is to copy the define() commands
from "ewiki.php" into "yoursite.php" (see our example "config.php"). This
is a good idea, because then your settings won't get lost if you upgrade
to a newer version by overwriting your tweaked "ewiki.php".
[Note: constants in PHP can be defined() once only, so
pre-defining them in "yoursite.php" or a "config.php"
script is nearly like a 'configuration']
To define() some of those constants in 'yoursite.php' is especially a good
thing, because some of them are more used like state variables and it may
be more senseful to set them depending on informations only available in
the scripts of yoursite.php (for example if yourscripts provide a way to
authenticate and login a user you could give him additional rights within
ewiki by pre-defining one of the following constants).
EWIKI_SCRIPT
This is the most important setting. It is used by ewiki.php
to generate links to other WikiPages.
It needs the name of yourscript.php which itself includes
ewiki.php.
The name of the linked WikiPage is just appended to the string
defined here, so you must ensure that it either ends in "/"
or "?id=" or "?name=" or "?page=" so it constructs a valid
URL after concatenation (or %s replaced) with the WikiPageName.
If you utilize mod_rewrite on your server, you may wish to
make it blank when all requests to http://wiki.example.com/
are redirected to the correct script by your WebServer.
If your wrapper script for example is called 'index.php' then you
can just set EWIKI_SCRIPT to "?page=" (which then refers to the
index.php of the current directory).
You should preferrably set it absolute to the servers DocumentRoot,
which gets a requirement if you'd like to give page names and actions
via PATH_INFO "/wiki.php/WikiPage" and not as QUERY_STRING "?id=".
Update: this constant will stay, but the core script now utilizes
the ewiki_script() function (which itself additionally respects
the $ewiki_config["script"] config variable in favour).
ewiki_script() introduces use of the "%s" placeholder inside
EWIKI_SCRIPT, which will be replaced by pagename and action, when
URLs are generated.
EWIKI_SCRIPT_URL
Some parts of ewiki require the absolute URL of the ewiki wrapper
script. So in contrast to the (often) short EWIKI_SCRIPT, this
constant MUST contain the protocol and server name, like:
"http://www.example.com/wiki/index.php?id="
If you do not set this constant, it will be guessed by the
ewiki_script_url() funciton, what often works but may be suboptimal
and could also lead to security problems.
EWIKI_DB_TABLE_NAME
Sets the name of the MySQL database table name to be created
and used to store all WikiPages.
EWIKI_DBQUERY_BUFFER
When set to a value>0 then SQL database buffering will be enabled
for SEARCH and GETALL queries. This is mostly like the old (R1.00)
behaviour (memory exhaustive), but instead is limited to the size
defined by this configuration constant (for example 384K).
EWIKI_DBFILES_DIRECTORY
Defines where db_flat_files puts the database (made up of files).
There is a separate paragraph about this,
EWIKI_DBFILES_ENCODE
If set to 1 will generate urlencoded() filenames even on UNIX
systems, so the dbff database 'files' get exchangeable across
DOS/Win and UNIX filesystems. Not recommended, and will make
ewiki run bogus, if you switch it after there already entries
in the database.
It may however be useful to enable this per default, if you want to
"backup" (this is the wrong way) from a Unix server to a Win box via
an ordinary FTP program (more professional tools could however handle
this more easily).
EWIKI_DBFILES_NLR
Used by flat files backends to encode newline characters.
EWIKI_DBFILES_GZLEVEL
Compression level for fast flat files and dba backend.
EWIKI_DBA
File name of .db3 data file, if the dba/dbx backend was used.
EWIKI_INIT_PAGES
Names the directory from which the basic pages should be read and
then written into the database, when ewiki is run the very first
time (or the FrontPage - EWIKI_PAGE_INDEX) is still empty.
Btw, you could use the 'ewikictl' utility to export all your Wiki
pages into this directory as auto-reinit-backup.
EWIKI_NAME
Defines the name of your Wiki. (This is not used currently, but
is required, as _PAGE_INDEX is often just set to "FrontPage".)
EWIKI_PAGE_INDEX
This defines the name of the WikiPage which shall be displayed
when no value is received within the URL. Often this is called
the "FrontPage" of the Wiki.
The mysql error message "Table 'ewiki' already exists" will appear
until you create (and fill) the page specified herein.
If you'd like to have a wiki without FrontPage, you can set this
constant to 0 or "" - you must then however ensure, that the ewiki
script is never activated without a page name!
EWIKI_PAGE_NEWEST
This defined the name of the virtual (internally generated) page
containing a list of the lately added WikiPages.
EWIKI_PAGE_SEARCH
Holds the WikiPageName for the search function.
EWIKI_PAGE_LIST
List of all pages.
EWIKI_PAGE_HITS
Pages ordered by most hits.
EWIKI_PAGE_VERSIONS
Page list sorted by number of changes/revisions.
EWIKI_PAGE_UPDATES
"UpdatedPages"
EWIKI_CONTROL_LINE
Pre-define this with 0 before including("ewiki.php") if you
don't want that "
EditThisPage ..." to be shown
at the bottom of each page.
You must then generate the EditThisPage link yourself somewhere
else on yoursite.php - It is often easier to simply edit the
ewiki_control_links() function to match the layout/design of yoursite.
EWIKI_LIST_LIMIT
Number of pages to show up in search queries (and other generated
pages).
EWIKI_PRINT_TITLE
If set to 0 will prevent the page title from being shown on many
pages (generated and database content ones).
EWIKI_SPLIT_TITLE
If changed to 1 will separate WikiPages titles into its different
word parts (only on top of each page).
EWIKI_DEFAULT_ACTION
EWIKI_AUTO_EDIT
If set to 1 (default) will automatically bring up the edit box
for non-existent pages. Else a page in between will appear ("please
edit me!") like in PhpWiki.
EWIKI_EDIT_REDIRECT
EWIKI_RESOLVE_DNS
EWIKI_HTTP_HEADERS
Allows ewiki to throw HTTP headers, where appropriate. You should keep
it enabled, as it allows for things like RedirectionAfterEdit (when
a page gets saved), and many other useful things.
headers() can often only be sent, if your wiki/yoursite.php is binary
safe, or uses PHPs output buffering (less reliable).
EWIKI_HTTP_HEADERS
Instructs browsers not to cache delivered pages at all. This is often
a good thing, because otherwise unclever caches will prevent the most
recent wikipage version to get seen by users.
EWIKI_NO_CACHE
Sends appropriate header to effectively prevent caching of pages
(since they change quickly).
EWIKI_CASE_INSENSITIVE
Was only recently implemented, but ewiki is fully configurable now in
regards to WikiLink case. It is enabled per default, and thus allows
referencing any "WikiPage" using strings like "WiKipAgE". This is
believed to be more user-friendly than case-dependency.
Reverting to "binary" page name matching is not fully complete now (our
database scheme was designed for case-insensitivity from the very start
and thus the DB code first needs tweaking before links in ewiki really
get case-dependent. (case-insensitivity in ewiki.php means, that
everything is converted into lowercase characters for comparisions)
EWIKI_HIT_COUNTING
Enable counting of page views.
EWIKI_URLENCODE
EWIKI_URLDECODE
You shouldn't disable both unless you know, you don't need to encode
WikiPageNames (else almost always necessary for sanity and security
reasons).
EWIKI_USE_PATH_INFO
If you have a broken Webserver (like many Apache versions), you may
wish to disable the use of PATH_INFO. If you ever happen to see
"Edit page '/wiki/example-1.php'", you probably need to disable it.
EWIKI_USE_ACTION_PARAM
Allows the page action command to be given as '&action=...' within
an URL (else only "action/WikiPage" allowed). You want to leave that
enabled.
If you set this constant to 2, ewiki will default to actively create
such URLs (instead of using the "edit/PageName" prefix). If set so you
should then disable EWIKI_ACTION_TAKE_ASIS, and you probably want to
edit EWIKI_SCRIPT to make ewiki emit _PATH_INFO style URLs as seen in
other WikiWare.
EWIKI_ACTION_SEP_CHAR
Defines the character that separates the page name from the action
name in generated URLs. Per default this is the slash, but you
could use something else (like the ":" colon), which however may
have a few drawbacks somewhere else.
EWIKI_ACTION_TAKE_ASIS
If kept enabled, ewiki will always take anything before a slash
in the given ?id= as action. If set to 0, it will however check
if such an action exists (or is enabled) at all, thus making it
easier to retrieve ?id=With/Slashes in it (without ewiki suddenly
treating the first part as $action string).
EWIKI_SUBPAGE_LONGTITLE
EWIKI_SUBPAGE_START
EWIKI_SUBPAGE_CHARS
Character classes used to decipher SubPages (an optional extension).
EWIKI_ESCAPE_AT
Encodes the "@" sign into a html entities, which in the past helped
a little bit against address rippers. But please check out the new
plugins/email_protect.php, which is more effective against email
harvesters.
EWIKI_ALLOW_HTML
Usually you do not want that users are able to add tags
inside the WikiPages as this allows for corruption of your page
layout or creation of harmful JavaScript areas.
This is however one of the few constants which could be set by
yoursite.php for logged-in users. If it is set while a user
saves a changed page, then the special EWIKI_DB_F_HTML will
be set for the newly created version, so won't be
garbaged by ewiki_format() if another (not logged-in) user
requests the WikiPage next time.
You must start a line with a "|" to actually make the HTML
work within a WikiPage.
If a not logged-in user however re-saves the page this flag
won't be set anymore, so you should be careful about that.
{{edit ewiki.php and define(_DB_F_HTML with 8+16) to change}}
EWIKI_RESCUE_HTML
Was replaced by "plugins/markup_rescuehtml.php", which now allows
for certain 'safe' HTML tags within the wiki source to be used.
EWIKI_HTML_CHARS
If set the rendering function will backconvert html entities which
represent non-latin characters, like ႊ or Ԭ
EWIKI_DB_F_*
Page flags are associated to every page and can be used to effectively
tweak access restrictions and behaviour of individual text pieces.
There are various tools/ to tweak them in a running database.
EWIKI_DB_F_TEXT
This flag is set for every WikiPage inside the database. Usually
the only flag set on creation of a new page.
Starting from R1.00b previous flags will be copied after applying
EWIKI_DB_F_COPYMASK.
EWIKI_DB_F_BINARY
Used for cached/uploaded images. Prevents a page from getting
shown.
EWIKI_DB_F_DISABLED
If set will prevent the page from being shown. Not useful.
You could more easily unset the TEXT flag to disable page view.
EWIKI_DB_F_HTML
Special flag to allow the current version to include
tags regardless of the global EWIKI_ALLOW_HTML setting.
EWIKI_DB_F_READONLY
Prevents a new version to be saved, and thus disallows
editing of the WikiPage.
EWIKI_DB_F_WRITEABLE
Is the reversal of READONLY but only useful if you crippled
ewiki by setting EWIKI_EDIT_AUTHENTICATE, as this flag is only
intended to reallow editing of a page if you disallowed it before
with _EDIT_AUTH (which denies access to _all_ pages).
EWIKI_DB_F_APPENDONLY
Gets implemented by the plugins/append*.php, and allows to lock
a page, in that users can only append to edit (or edit parts of
it). See the plugin description for more details.
EWIKI_DB_F_SYSTEM
Is used to mark internally used data holders (usually serialized()
variables).
EWIKI_DB_F_PART
Denotes a page that first must be merged with others (only one piece
of a larger group of pages).
EWIKI_DB_F_MINOR
Signalizes hiding that revision on RecentChanges and UpatedPages.
EWIKI_DB_F_HIDDEN
Page shouldn't show up on any of the automatically generated page
lists (like RecentChanges and SearchPages). Links on pages will still
be rendered normally, unless the deadlyhidden plugin was loaded.
EWIKI_DB_F_ARCHIVE
Excludes a page/version from automated deletion (cron scripts).
EWIKI_DB_F_EXEC
Marks a system page containing executable (PHP) code. Not a core
feature, only used by xpi plugins to date.
EWIKI_DB_F_TYPE
Used internally to separate TEXT, BINARY, DISABLED and SYSTEM entries.
EWIKI_DB_F_ACCESS
Is a mask to check for READONLY, WRITEABLE and APPENDONLY flags.
EWIKI_DB_F_COPYMASK
When a new page is created, the flags of the previous version
are ANDed with this value to strip off some unsafe settings.
Note, that the _HTML and a few other feature flags are now copied
as well, so you may want to set a page _READONLY once you enabled
"unsafe" options.
Always keep in mind, that flags could be reimported from previous versions
as well - it hasn't been verified, but that could happen.
EWIKI_PROTECTED_MODE
Is an operation mode of ewiki, which activates ewiki_auth() function,
that is utilized from many places to require a permission level (from
authenticated users). Set this constant to 1 to enable this mode.
You'll also need some plugins from plugins/auth/ to make this useful.
If this constant is set to 2, then you don't need a permission plugin,
but can control access to the edit/ function, by setting $ewiki_ring
to 2 (to allow) from within yoursite.php scripts. This setting is also
sometimes referred to as the "ClassicProtectedMode".
EWIKI_FLAT_REAL_MODE
Not a configuration directive, but the opposite to _PROTECTED_MODE ;)
EWIKI_AUTH_DEFAULT_RING
Is the permission level which is to be set, if no user is logged in
currently (defaults to 3 - which means "browsing only").
EWIKI_AUTO_LOGIN
If this is enabled, then ewiki_page() automatically requests for
(re-)presenting the login