\n", 'iso-8859-1'); ?>

Configuration tool for PhpWiki 1.3.x

This tool is provided for testing purposes only. It's not finished so don't try to use it to configure your server yet.

Unixish systems: /usr/share/php /usr/local/share/php Mac OS X: /System/Library/PHP The 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 found
Define 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['partnull'] = new part('Part Null', " define ('PHPWIKI_VERSION', '1.3.2-jeffs-hacks'); require \"lib/prepend.php\"; rcs_id('$Id: configurator.php,v 1.1 2002-02-22 07:12:09 carstenklapp Exp $'); ", " Part Null: Don't touch this!"); $properties['partone'] = new part('Part One', "/////////////////////////////////////////////////////////////////// ", " Part One: Authentication and security settings: "); $properties['Wiki Name'] = new defines('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 defines_boolean('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 defines('ADMIN_USER', "", " Username and password of administrator. Set these to your preferences. For heaven's sake pick a good password!"); $properties['Admin Password'] = new defines('ADMIN_PASSWD', "", ""); $properties['ZIPdump Authentication'] = new defines_boolean('ZIPDUMP_AUTH', array('false' => 'everyone', 'true' => 'only admin'), " If true, only the admin user can make zip dumps, else zip dumps require no authentication."); $properties['Strict Mailable Pagedumps'] = new defines_boolean('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['Maximum Upload Size'] = new defines_numeric('MAX_UPLOAD_SIZE', "16 * 1024 * 1024", " The maximum file upload size."); $properties['Minor Edit Timeout'] = new defines_numeric('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."); // MORE CONFIG OPTIONS GO IN HERE $properties['Character Set'] = new defines('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 selection('LANG', array('C' => 'English', 'nl' => 'Nederlands', 'es' => 'Español', 'fr' => 'Français', 'de' => 'Deutsch', 'sv' => 'Svenska', 'it' => 'Italiano'), " 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'."); // MORE CONFIG OPTIONS GO IN HERE // end of configuration options /////////////////////////////// // begin class definitions /** * A basic property. * * Produces a string in the form "$name = value;" * e.g.: * $InlineImages = "png|jpg|gif"; */ class property { var $config_item_name; var $default_value; var $description; function property($config_item_name, $default_value, $description) { $this->config_item_name = $config_item_name; $this->description = $description; $this->default_value = $default_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->get_config_item_name() . " = \"" . $posted_value . "\";"; } function get_config($posted_value) { $d = str_replace("
", "", $this->get_description());
        $d = str_replace("
", "", $d); $d = str_replace("\n", "\n// ", $d) . $this->get_config_line($posted_value) ."\n"; return $d; } function get_instructions($title) { $i = "

" . $title . "

\n

" . str_replace("\n\n", "

", $this->get_description()) . "

\n"; return "\n\n" . $i . "\n"; } function get_html() { return "get_config_item_name() . "\" value=\"" . $this->default_value . "\">"; } } class selection extends property { function get_html() { $output = '\n \n"; return $output; } } class defines extends property { function get_config_line($posted_value) { if ($this->description) $n = "\n"; if ($posted_value == '') return "${n}//define('".$this->get_config_item_name()."', \"\");"; else return "${n}define('".$this->get_config_item_name()."', '$posted_value');"; } } class defines_numeric extends property { function get_config_line($posted_value) { if ($this->description) $n = "\n"; if ($posted_value == '') return "${n}//define('".$this->get_config_item_name()."', 0);"; else return "${n}define('".$this->get_config_item_name()."', $posted_value);"; } } class iniset extends property { function get_config_line($posted_value) { if ($posted_value) return "\nini_set('".$this->get_config_item_name()."', '$posted_value');"; else return "\n//ini_set('".$this->get_config_item_name()."', '\$".$this->get_config_item_name()."');"; } } class defines_boolean extends property { function get_config_line($posted_value) { if ($this->description) $n = "\n"; return "${n}define('".$this->get_config_item_name()."', $posted_value);"; } function get_html() { $output = '\n \n"; return $output; } } class part extends property { function get_config($posted_value) { $separator = "\n/////////////////////////////////////////////////////////////////////"; return $separator . str_replace("\n", "\n// ", $this->get_description()) ."\n$this->default_value"; } function get_instructions($title) { $i = "

".$this->get_config_item_name()."

\n$this->description\n"; return "\n\n" .$i ."\n"; } function get_html() { return ""; } } // end of class definitions ///////////////////////////// // begin auto generation code if ($action == 'make_config') { $timestamp = date ('dS of F, Y H:i:s'); $config = "
\n";
    print_r($GLOBALS['HTTP_POST_VARS']);
    echo "

\n"; /* */ foreach($properties as $option_name => $a) { $posted_value = $posted[$a->config_item_name]; $config .= $properties[$option_name]->get_config($posted_value); } $diemsg = "The configurator.php is provided for testing purposes only.\nYou can't use this file with your PhpWiki server yet!!"; $config .= "\ndie(\"$diemsg\");"; $config .= "\n?>\n"; /* We first check if the config-file exists. */ if (file_exists('defaults.php')) { /* We make a backup copy of the file */ $new_filename = 'defaults.' . time() . '.php'; if (@copy('defaults.php', $new_filename)) { $fp = @fopen('defaults.php', 'w'); } } else { $fp = @fopen('defaults.php', 'w'); } if ($fp) { fputs($fp, $config); fclose($fp); echo "

The configuration was written to defaults.php. A backup was made to $new_filename.

\n"; } else { echo "

A configuration file could not be written. You should copy the above configuration to a file, and manually save it as defaults.php.

\n"; } echo "
\n

Here's the configuration file based on your answers:

\n
\n";
    echo htmlentities($config);
    echo "
\n
\n"; echo "\n"; echo "

Would you like to play again?

\n"; } else { /* No action has been specified - we make a form. */ echo '
'; while(list($property, $obj) = each($properties)) { echo $obj->get_instructions($property); if ($h = $obj->get_html()) echo "\n"; } echo '
".$h."

'; } ?>