\n", 'iso-8859-1'); ?>
Unixish systems: /usr/share/php /usr/local/share/php Mac OS X: /System/Library/PHPThe above examples are already included by PhpWiki. You shouldn't have to change this unless you see a WikiFatalError:
lib/FileFinder.php:82: Fatal[256]: DB.php: file not foundDefine the include path for this wiki: pear plus the phpwiki path
$include_path = '.:/Apache/php/pear:/prog/php/phpwiki';Windows needs ';' as path delimiter. cygwin, mac and unix ':'
if (substr(PHP_OS,0,3) == 'WIN') { $include_path = implode(';',explode(':',$include_path)); } elseif (substr(PHP_OS,0,6) == 'CYGWIN') { $include_path = '.:/usr/local/lib/php/pear:/usr/src/php/phpwiki'; } else { ; }"); $properties["Part Null"] = new part('_partnullheader', "", " Part Null: Don't touch this!"); $properties["Part Null Settings"] = new unchangeable_variable('_partnullsettings', " define ('PHPWIKI_VERSION', '1.3.3-jeffs-hacks'); require \"lib/prepend.php\"; rcs_id('\$Id: configurator.php,v 1.5 2002-03-26 22:29:06 carstenklapp Exp $');", ""); $properties["Part One"] = new part('_partone', $SEPARATOR."\n", " Part One: Authentication and security settings: "); $properties["Wiki Name"] = new _define('WIKI_NAME', ''/*'PhpWiki'*/, " The name of your wiki. This is used to generate a keywords meta tag in the HTML templates, in bookmark titles for any bookmarks made to pages in your wiki, and during RSS generation for the title of the RSS channel."); $properties["Reverse DNS"] = new boolean_define('ENABLE_REVERSE_DNS', array('true' => "perform additional reverse dns lookups", 'false' => "just record the address as given by the httpd server"), " If set, we will perform reverse dns lookups to try to convert the users IP number to a host name, even if the http server didn't do it for us."); $properties["Admin Username"] = new _define('ADMIN_USER', "", " Username and password of administrator. Set these to your preferences. For heaven's sake pick a good password!"); $properties["Admin Password"] = new _define_password('ADMIN_PASSWD', "", ""); $properties["ZIPdump Authentication"] = new boolean_define('ZIPDUMP_AUTH', array('false' => "everyone may download zip dumps", 'true' => "only admin may download zip dumps"), " If true, only the admin user can make zip dumps, else zip dumps require no authentication."); $properties["Strict Mailable Pagedumps"] = new boolean_define('STRICT_MAILABLE_PAGEDUMPS', array('false' => "binary", 'true' => "quoted-printable"), " If you define this to true, (MIME-type) page-dumps (either zip dumps, or \"dumps to directory\" will be encoded using the quoted-printable encoding. If you're actually thinking of mailing the raw page dumps, then this might be useful, since (among other things,) it ensures that all lines in the message body are under 80 characters in length. Also, setting this will cause a few additional mail headers to be generated, so that the resulting dumps are valid RFC 2822 e-mail messages. Probably, you can just leave this set to false, in which case you get raw ('binary' content-encoding) page dumps."); $properties["HTML Dump Filename Suffix"] = new _variable('HTML_DUMP_SUFFIX', ".html", " Here you can change the filename suffix used for XHTML page dumps. If you don't want any suffix just comment this out."); $properties["Maximum Upload Size"] = new numeric_define('MAX_UPLOAD_SIZE', "16 * 1024 * 1024", " The maximum file upload size."); $properties["Minor Edit Timeout"] = new numeric_define('MINOR_EDIT_TIMEOUT', "7 * 24 * 3600", " If the last edit is older than MINOR_EDIT_TIMEOUT seconds, the default state for the \"minor edit\" checkbox on the edit page form will be off."); $properties["Disabled Actions"] = new array_variable('DisabledActions', array(), " Actions listed in this array will not be allowed. Actions are: browse, diff, dumphtml, dumpserial, edit, loadfile, lock, remove, unlock, upload, viewsource, zip, ziphtml"); $properties["Access Log"] = new _define('ACCESS_LOG', "", " PhpWiki can generate an access_log (in \"NCSA combined log\" format) for you. If you want one, define this to the name of the log file, such as /tmp/wiki_access_log."); $properties["Strict Login"] = new boolean_define('ALLOW_BOGO_LOGIN', array('true' => "Users may Sign In with any WikiWord", 'false' => "Only admin may Sign In"), " If ALLOW_BOGO_LOGIN is true, users are allowed to login (with any/no password) using any userid which: 1) is not the ADMIN_USER, 2) is a valid WikiWord (matches \$WikiNameRegexp.)"); $properties["Require Sign In Before Editing"] = new boolean_define('REQUIRE_SIGNIN_BEFORE_EDIT', array('false' => "Do not require Sign In", 'true' => "Require Sign In"), " If set, then if an anonymous user attempts to edit a page he will be required to sign in. (If ALLOW_BOGO_LOGIN is true, of course, no password is required, but the user must still sign in under some sort of BogoUserId.)"); $properties["Path for PHP Session Support"] = new _ini_set('session.save_path', 'some_other_directory', " The login code now uses PHP's session support. Usually, the default configuration of PHP is to store the session state information in /tmp. That probably will work fine, but fails e.g. on clustered servers where each server has their own distinct /tmp (this is the case on SourceForge's project web server.) You can specify an alternate directory in which to store state information like so (whatever user your httpd runs as must have read/write permission in this directory):"); $properties["Disable PHP Transparent Session ID"] = new unchangeable_variable('session.use_trans_sid', "@ini_set('session.use_trans_sid', 0);", " If your php was compiled with --enable-trans-sid it tries to add a PHPSESSID query argument to all URL strings when cookie support isn't detected in the client browser. For reasons which aren't entirely clear (PHP bug) this screws up the URLs generated by PhpWiki. Therefore, transparent session ids should be disabled. This next line does that. (At the present time, you will not be able to log-in to PhpWiki, or set any user preferences, unless your browser supports cookies.)"); ///////// database selection $properties["Part Two"] = new part('_parttwo', $SEPARATOR."\n", " Part Two: Database Selection "); $properties["Database Type"] = new _variable_selection("DBParams|dbtype", array('dba' => "dba DBM", 'SQL' => "SQL PEAR", 'ADODB' => "SQL ADODB"), " Select the database type:"); $properties["Filename / Table name Prefix"] = new _variable_commented("DBParams|prefix", "phpwiki_", " Used by all DB types: prefix for filenames or table names currently you MUST EDIT THE SQL file too (in the schemas/ directory because we aren't doing on the fly sql generation during the installation.:"); $properties["SQL dsn Setup"] = new part('_sqldsnstuff', " ", " For SQL based backends, specify the database as a DSN The most general form of a DSN looks like:
phptype(dbsyntax)://username:password@protocol+hostspec/databaseFor a MySQL database, the following should work:
mysql://user:password@host/databasename
'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test', 'dsn' => 'mysql://guest@localhost/test', 'dsn' => 'pgsql://localhost/test',"); $properties["SQL Type"] = new _variable_selection('dsn_sqltype', array('mysql' => "MySQL", 'pgsql' => "PostgreSQL"), " SQL DB types"); $properties["SQL User"] = new _variable('dsn_sqluser', "wikiuser", " SQL User Id:"); $properties["SQL Password"] = new _variable('dsn_sqlpass', "", " SQL Password:"); $properties["SQL Database Host"] = new _variable('dsn_sqlhostorsock', "localhost", " SQL Database Hostname:"); $properties["SQL Database Name"] = new _variable('dsn_sqldbname', "phpwiki", " SQL Database Name:"); $properties["SQL dsn"] = new unchangeable_variable("DBParams['dsn']", "\$DBParams['dsn'] = \"\$dsn_sqltype://\$dsn_sqluser:\$dsn_sqlpass@\$dsn_sqlhostorsock/\$dsn_sqldbname\";", " "); $properties["dba directory"] = new _variable("DBParams|directory", "/tmp", " dba directory:"); $properties["dba handler"] = new _variable_selection('DBParams|dba_handler', array('gdbm' => "Gdbm - GNU database manager", 'db2' => "DB2 - Sleepycat Software's DB2", 'db3' => "DB3 - Sleepycat Software's DB3"), " Use 'gdbm', 'db2', or db3 depending on your database:"); $properties["dba timeout"] = new _variable("DBParams|timeout", "20", " Recommended values are 20 or 5."); /////////////////// $properties["Page Revisions"] = new part('_parttworevisions', " ", " The next section controls how many old revisions of each page are kept in the database. There are two basic classes of revisions: major and minor. Which class a revision belongs in is determined by whether the author checked the \"this is a minor revision\" checkbox when they saved the page. There is, additionally, a third class of revisions: author revisions. The most recent non-mergable revision from each distinct author is and author revision. The expiry parameters for each of those three classes of revisions can be adjusted seperately. For each class there are five parameters (usually, only two or three of the five are actually set) which control how long those revisions are kept in the database.
define('THEME', 'default'); define('THEME', 'Hawaiian'); define('THEME', 'MacOSX'); define('THEME', 'Portland'); define('THEME', 'Sidebar'); define('THEME', 'SpaceWiki');"); $properties["Character Set"] = new _define('CHARSET', 'iso-8859-1', " Select a valid charset name to be inserted into the xml/html pages, and to reference links to the stylesheets (css). For more info see: http://www.iana.org/assignments/character-sets. Note that PhpWiki has been extensively tested only with the latin1 (iso-8859-1) character set. If you change the default from iso-8859-1 PhpWiki may not work properly and it will require code modifications. However, character sets similar to iso-8859-1 may work with little or no modification depending on your setup. The database must also support the same charset, and of course the same is true for the web browser. (Some work is in progress hopefully to allow more flexibility in this area in the future)."); $properties["Language"] = new _variable_selection('LANG', array('C' => "English", 'nl' => "Nederlands", 'es' => "Español", 'fr' => "Français", 'de' => "Deutsch", 'sv' => "Svenska", 'it' => "Italiano", '' => "none"), " Select your language/locale - default language is \"C\" for English. Other languages available:
English \"C\" (English - HomePage) Dutch \"nl\" (Nederlands - ThuisPagina) Spanish \"es\" (Español - PáginaPrincipal) French \"fr\" (Français - Accueil) German \"de\" (Deutsch - StartSeite) Swedish \"sv\" (Svenska - Framsida) Italian \"it\" (Italiano - PaginaPrincipale)If you set \$LANG to the empty string, your systems default language (as determined by the applicable environment variables) will be used. Note that on some systems, apprently using these short forms for the locale won't work. On my home system 'LANG=de' won't result in german pages. Somehow the system must recognize the locale as a valid locale before gettext() will work, i.e., use 'de_DE', 'nl_NL'."); $properties["Wiki Page Source"] = new _define('WIKI_PGSRC', 'pgsrc', " WIKI_PGSRC -- specifies the source for the initial page contents of the Wiki. The setting of WIKI_PGSRC only has effect when the wiki is accessed for the first time (or after clearing the database.) WIKI_PGSRC can either name a directory or a zip file. In either case WIKI_PGSRC is scanned for files -- one file per page.
define('WIKI_PGSRC', 'pgsrc'); // Default (old) behavior. define('WIKI_PGSRC', 'wiki.zip'); // New style. define('WIKI_PGSRC', '../../../Logs/Hamwiki/hamwiki-20010830.zip'); // New style."); $properties["Default Wiki Page Source"] = new _define('DEFAULT_WIKI_PGSRC', 'pgsrc', " DEFAULT_WIKI_PGSRC is only used when the language is *not* the default (English) and when reading from a directory: in that case some English pages are inserted into the wiki as well. DEFAULT_WIKI_PGSRC defines where the English pages reside. FIXME: is this really needed? "); $properties["Generic Pages"] = new array_variable('GenericPages', array('ReleaseNotes', 'SteveWainstead', 'TestPage'), " These are the pages which will get loaded from DEFAULT_WIKI_PGSRC. FIXME: is this really needed? Can't we just copy these pages into the localized pgsrc? "); $properties["Part Four"] = new part('_partfour', $SEPARATOR."\n", " Part Four: Mark-up options. "); $properties["Allowed Protocols"] = new list_variable('AllowedProtocols', 'http|https|mailto|ftp|news|nntp|ssh|gopher', " allowed protocols for links - be careful not to allow \"javascript:\" URL of these types will be automatically linked. within a named link [name|uri] one more protocol is defined: phpwiki"); $properties["Inline Images"] = new list_variable('InlineImages', 'png|jpg|gif', " URLs ending with the following extension should be inlined as images"); $properties["WikiName Regexp"] = new _variable('WikiNameRegexp', "(? 'do not use PATH_INFO', 'true' => 'use PATH_INFO'), " Define to 'true' to use PATH_INFO to pass the pagenames. e.g. http://www.some.where/index.php/HomePage instead of http://www.some.where/index.php?pagename=HomePage FIXME: more docs (maybe in README)."); $properties["Virtual Path"] = new _define_commented('VIRTUAL_PATH', '/SomeWiki', " VIRTUAL_PATH is the canonical URL path under which your your wiki appears. Normally this is the same as dirname(SCRIPT_NAME), however using, e.g. apaches mod_actions (or mod_rewrite), you can make it something different. If you do this, you should set VIRTUAL_PATH here. E.g. your phpwiki might be installed at at /scripts/phpwiki/index.php, but you've made it accessible through eg. /wiki/HomePage. One way to do this is to create a directory named 'wiki' in your server root. The directory contains only one file: an .htaccess file which reads something like:
Action x-phpwiki-page /scripts/phpwiki/index.php SetHandler x-phpwiki-page DirectoryIndex /scripts/phpwiki/index.phpIn that case you should set VIRTUAL_PATH to '/wiki'. (VIRTUAL_PATH is only used if USE_PATH_INFO is true.) "); $end = " $SEPARATOR // Okay... fire up the code: $SEPARATOR include \"lib/main.php\"; // (c-file-style: \"gnu\") // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?> "; // end of configuration options /////////////////////////////// // begin class definitions /** * A basic index.php configuration line in the form of a variable. * * Produces a string in the form "$name = value;" * e.g.: * $WikiNameRegexp = "value"; */ class _variable { var $config_item_name; var $default_value; var $description; function _variable($config_item_name, $default_value, $description) { $this->config_item_name = $config_item_name; $this->description = $description; $this->default_value = $default_value; } function _config_format($value) { $v = $this->get_config_item_name(); // handle arrays: a|b --> a['b'] if (strpos($v, '|')) { list($a, $b) = explode('|', $v); $v = sprintf("%s['%s']", $a, $b); } return sprintf("\$%s = \"%s\";", $v, $value); } function get_config_item_name() { return $this->config_item_name; } function _get_description() { return $this->description; } function _get_config_line($posted_value) { return "\n" . $this->_config_format($posted_value); } function get_config($posted_value) { $d = stripHtml($this->_get_description()); $d = str_replace("\n", "\n// ", $d) . $this->_get_config_line($posted_value) ."\n"; return $d; } function get_instructions($title) { $i = "
" . $title . "
" . $title . "
" . $this->default_value.""; return "
" . $title . "
" . str_replace("\n\n", "
\n", $text) . "
"; } function stripHtml($text) { $d = str_replace("", "", $text); $d = str_replace("", "", $d); $d = str_replace("
\n"; print_r($a); echo "\n\n
The configuration was written to settings.php
.
A backup was made to $new_filename
.
You must rename or copy this settings.php
file to index.php
.
A configuration file could not be written. You should copy the above configuration to a file, and manually save it as index.php
.
Here's the configuration file based on your answers:
\n\n"; echo htmlentities($config); echo "\n
To make any corrections, edit the settings again.
\n"; } else { /* No action has been specified - we make a form. */ echo ' '; } ?>