2 rcs_id('$Id: config.php,v 1.30 2001-02-12 01:43:10 dairiki Exp $');
4 * NOTE: the settings here should probably not need to be changed.
7 * (The user-configurable settings have been moved to index.php.)
10 // essential internal stuff
12 set_magic_quotes_runtime(0);
16 // "\x80"-"\x9f" (and "\x00" - "\x1f") are non-printing control
17 // chars in iso-8859-*
18 // $FieldSeparator = "\263"; //this is a superscript 3 in ISO-8859-1.
19 $FieldSeparator = "\x81";
22 // constants for flags in $pagehash
23 define("FLAG_PAGE_LOCKED", 1);
25 //////////////////////////////////////////////////////////////////
27 // Set up localization
29 if (!function_exists ('gettext'))
33 function gettext ($text) {
35 if (!empty ($locale[$text]))
36 return $locale[$text];
40 if ( ($lcfile = SearchPath("LC_MESSAGES/phpwiki.php", 'missing_ok')) )
47 putenv ("LANG=$LANG");
48 bindtextdomain ("phpwiki", "./locale");
49 textdomain ("phpwiki");
52 //////////////////////////////////////////////////////////////////
53 // Autodetect URL settings:
55 if (!defined('SERVER_NAME')) define('SERVER_NAME', $SERVER_NAME);
56 if (!defined('SERVER_PORT')) define('SERVER_PORT', $SERVER_PORT);
57 if (!defined('SCRIPT_NAME')) define('SCRIPT_NAME', $SCRIPT_NAME);
58 if (!defined('DATA_PATH'))
59 define('DATA_PATH', dirname(SCRIPT_NAME));
60 if (!defined('USE_PATH_INFO'))
63 * If SCRIPT_NAME does not look like php source file,
64 * or user cgi we assume that php is getting run by an
65 * action handler in /cgi-bin. In this case,
66 * I think there is no way to get Apache to pass
67 * useful PATH_INFO to the php script (PATH_INFO
68 * is used to the the php interpreter where the
71 define('USE_PATH_INFO', ereg('\.(php3?|cgi)$', $SCRIPT_NAME));
73 if (!defined('VIRTUAL_PATH'))
75 if (USE_PATH_INFO and isset($REDIRECT_URL))
77 // FIXME: This is a hack, and won't work if the requested
78 // pagename has a slash in it.
79 define('VIRTUAL_PATH', dirname($REDIRECT_URL . 'x'));
82 define('VIRTUAL_PATH', SCRIPT_NAME);
85 if (SERVER_PORT && SERVER_PORT != 80)
87 "http://" . SERVER_NAME . ':' . SERVER_PORT);
90 "http://" . SERVER_NAME);
92 if (VIRTUAL_PATH != SCRIPT_NAME)
94 // Apache action handlers are used.
95 define('PATH_INFO_PREFIX', VIRTUAL_PATH . "/");
98 define("PATH_INFO_PREFIX", '/');
101 //////////////////////////////////////////////////////////////////
104 if (!defined('DBTYPE'))
106 if ( floor(phpversion()) == 3) {
107 define('DBTYPE', 'dbm');
109 define('DBTYPE', 'dba');
116 include 'lib/dbmlib.php';
119 include 'lib/dbalib.php';
122 include 'lib/mysql.php';
125 include 'lib/pgsql.php';
128 include 'lib/msql.php';
131 include "lib/db_filesystem.php";
134 die(DBTYPE . ": unknown DBTYPE");
137 // InterWiki linking -- wiki-style links to other wikis on the web
139 if (defined('INTERWIKI_MAP_FILE'))
141 include ('lib/interwiki.php');
147 // c-file-style: "ellemtel"