]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/config.php
add db-check db-rebuild for dba links
[SourceForge/phpwiki.git] / lib / config.php
1 <?php
2 rcs_id('$Id: config.php,v 1.139 2006-03-19 14:50:42 rurban Exp $');
3 /*
4  * NOTE: The settings here should probably not need to be changed.
5  * The user-configurable settings have been moved to IniConfig.php
6  * The run-time code has been moved to lib/IniConfig.php:fix_configs()
7  */
8  
9 if (!defined("LC_ALL")) {
10     // Backward compatibility (for PHP < 4.0.5)
11     if (!check_php_version(4,0,5)) {
12         define("LC_ALL",   "LC_ALL");
13         define("LC_CTYPE", "LC_CTYPE");
14     } else {
15         define("LC_ALL",   0);
16         define("LC_CTYPE", 2);
17     }
18 }
19 // debug flags: 
20 define ('_DEBUG_VERBOSE',   1); // verbose msgs and add validator links on footer
21 define ('_DEBUG_PAGELINKS', 2); // list the extraced pagelinks at the top of each pages
22 define ('_DEBUG_PARSER',    4); // verbose parsing steps
23 define ('_DEBUG_TRACE',     8); // test php memory usage, prints php debug backtraces
24 define ('_DEBUG_INFO',     16);
25 define ('_DEBUG_APD',      32);
26 define ('_DEBUG_LOGIN',    64); // verbose login debug-msg (settings and reason for failure)
27 define ('_DEBUG_SQL',     128);
28
29 function isCGI() {
30     return (substr(php_sapi_name(),0,3) == 'cgi' and 
31             isset($GLOBALS['HTTP_ENV_VARS']['GATEWAY_INTERFACE']) and
32             @preg_match('/CGI/',$GLOBALS['HTTP_ENV_VARS']['GATEWAY_INTERFACE']));
33 }
34
35 /*
36 // copy some $_ENV vars to $_SERVER for CGI compatibility. php does it automatically since when?
37 if (isCGI()) {
38     foreach (explode(':','SERVER_SOFTWARE:SERVER_NAME:GATEWAY_INTERFACE:SERVER_PROTOCOL:SERVER_PORT:REQUEST_METHOD:HTTP_ACCEPT:PATH_INFO:PATH_TRANSLATED:SCRIPT_NAME:QUERY_STRING:REMOTE_HOST:REMOTE_ADDR:REMOTE_USER:AUTH_TYPE:CONTENT_TYPE:CONTENT_LENGTH') as $key) {
39         $GLOBALS['HTTP_SERVER_VARS'][$key] = &$GLOBALS['HTTP_ENV_VARS'][$key];
40     }
41 }
42 */
43
44 // essential internal stuff
45 set_magic_quotes_runtime(0);
46
47 /** 
48  * Browser Detection Functions
49  *
50  * Current Issues:
51  *  NS/IE < 4.0 doesn't accept < ? xml version="1.0" ? >
52  *  NS/IE < 4.0 cannot display PNG
53  *  NS/IE < 4.0 cannot display all XHTML tags
54  *  NS < 5.0 needs textarea wrap=virtual
55  *  IE55 has problems with transparent PNG's
56  * @author: ReiniUrban
57  */
58 function browserAgent() {
59     static $HTTP_USER_AGENT = false;
60     if ($HTTP_USER_AGENT !== false) return $HTTP_USER_AGENT;
61     if (!$HTTP_USER_AGENT)
62         $HTTP_USER_AGENT = @$GLOBALS['HTTP_SERVER_VARS']['HTTP_USER_AGENT'];
63     if (!$HTTP_USER_AGENT) // CGI
64         $HTTP_USER_AGENT = @$GLOBALS['HTTP_ENV_VARS']['HTTP_USER_AGENT'];
65     if (!$HTTP_USER_AGENT) // local CGI testing
66         $HTTP_USER_AGENT = 'none';
67     return $HTTP_USER_AGENT;
68 }
69 function browserDetect($match) {
70     return strstr(browserAgent(), $match);
71 }
72 // returns a similar number for Netscape/Mozilla (gecko=5.0)/IE/Opera features.
73 function browserVersion() {
74     if (strstr(browserAgent(),    "Mozilla/4.0 (compatible; MSIE"))
75         return (float) substr(browserAgent(),30);
76     elseif (strstr(browserAgent(),"Mozilla/5.0 (compatible; Konqueror/"))
77         return (float) substr(browserAgent(),36);
78     else
79         return (float) substr(browserAgent(),8);
80 }
81 function isBrowserIE() {
82     return (browserDetect('Mozilla/') and 
83             browserDetect('MSIE'));
84 }
85 // problem with transparent PNG's
86 function isBrowserIE55() {
87     return (isBrowserIE() and 
88             browserVersion() > 5.1 and browserVersion() < 6.0);
89 }
90 // old Netscape prior to Mozilla
91 function isBrowserNetscape($version = false) {
92     $agent = (browserDetect('Mozilla/') and 
93             ! browserDetect('Gecko/') and
94             ! browserDetect('MSIE'));
95     if ($version) return $agent and browserVersion() >= $version; 
96     else return $agent;
97 }
98 // NS3 or less
99 function isBrowserNS3() {
100     return (isBrowserNetscape() and browserVersion() < 4.0);
101 }
102 // NS4 or less
103 function isBrowserNS4() {
104     return (isBrowserNetscape() and browserVersion() < 5.0);
105 }
106 // must omit display alternate stylesheets: konqueror 3.1.4
107 // http://sourceforge.net/tracker/index.php?func=detail&aid=945154&group_id=6121&atid=106121
108 function isBrowserKonqueror($version = false) {
109     if ($version) return browserDetect('Konqueror/') and browserVersion() >= $version; 
110     return browserDetect('Konqueror/');
111 }
112 // MacOSX Safari has certain limitations. Need detection and patches.
113 // * no <object>, only <embed>
114 function isBrowserSafari($version = false) {
115     if ($version) return browserDetect('Safari/') and browserVersion() >= $version; 
116     return browserDetect('Safari/');
117 }
118
119
120 /**
121  * If $LANG is undefined:
122  * Smart client language detection, based on our supported languages
123  * HTTP_ACCEPT_LANGUAGE="de-at,en;q=0.5"
124  *   => "de"
125  * We should really check additionally if the i18n HomePage version is defined.
126  * So must defer this to the request loop.
127  */
128 function guessing_lang ($languages=false) {
129     if (!$languages) {
130         // make this faster
131         $languages = array("en","de","es","fr","it","ja","zh","nl","sv");
132         // ignore possible "_<territory>" and codeset "ja.utf8"
133         /*
134         require_once("lib/Theme.php");
135         $languages = listAvailableLanguages();
136         if (defined('DEFAULT_LANGUAGE') and in_array(DEFAULT_LANGUAGE, $languages))
137         {
138             // remove duplicates
139             if ($i = array_search(DEFAULT_LANGUAGE, $languages) !== false) {
140                 array_splice($languages, $i, 1);
141             }
142             array_unshift($languages, DEFAULT_LANGUAGE);
143             foreach ($languages as $lang) {
144                 $arr = FileFinder::locale_versions($lang);
145                 $languages = array_merge($languages, $arr);
146             }
147         }
148         */
149     }
150
151     $accept = false; 
152     if (isset($GLOBALS['request'])) // in fixup-dynamic-config there's no request yet
153         $accept = $GLOBALS['request']->get('HTTP_ACCEPT_LANGUAGE');
154     elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
155         $accept = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
156
157     if ($accept) {
158         $lang_list = array();
159         $list = explode(",", $accept);
160         for ($i=0; $i<count($list); $i++) {
161             $pos = strchr($list[$i], ";") ;
162             if ($pos === false) {
163                 // No Q it is only a locale...
164                 $lang_list[$list[$i]] = 100;
165             } else {
166                 // Has a Q rating        
167                 $q = explode(";",$list[$i]) ;
168                 $loc = $q[0] ;
169                 $q = explode("=",$q[1]) ;
170                 $lang_list[$loc] = $q[1]*100 ;
171             }
172         }
173
174         // sort by q desc
175         arsort($lang_list);
176
177         // compare with languages, ignoring sublang and charset
178         foreach ($lang_list as $lang => $q) {
179             if (in_array($lang, $languages))
180                 return $lang;
181             // de_DE.iso8859-1@euro => de_DE.iso8859-1, de_DE, de
182             // de-DE => de-DE, de
183             foreach (array('@', '.', '_') as $sep) {
184                 if ( ($tail = strchr($lang, $sep)) ) {
185                     $lang_short = substr($lang, 0, -strlen($tail));
186                     if (in_array($lang_short, $languages))
187                         return $lang_short;
188                 }
189             }
190             if ($pos = strchr($lang, "-") and in_array(substr($lang, 0, $pos), $languages))
191                 return substr($lang, 0, $pos);
192         }
193     }
194     return $languages[0];
195 }
196
197 /**
198  * Smart setlocale().
199  *
200  * This is a version of the builtin setlocale() which is
201  * smart enough to try some alternatives...
202  *
203  * @param mixed $category
204  * @param string $locale
205  * @return string The new locale, or <code>false</code> if unable
206  *  to set the requested locale.
207  * @see setlocale
208  * [56ms]
209  */
210 function guessing_setlocale ($category, $locale) {
211     $alt = array('en' => array('C', 'en_US', 'en_GB', 'en_AU', 'en_CA', 'english'),
212                  'de' => array('de_DE', 'de_DE', 'de_DE@euro', 
213                                'de_AT@euro', 'de_AT', 'German_Austria.1252', 'deutsch', 
214                                'german', 'ge'),
215                  'es' => array('es_ES', 'es_MX', 'es_AR', 'spanish'),
216                  'nl' => array('nl_NL', 'dutch'),
217                  'fr' => array('fr_FR', 'français', 'french'),
218                  'it' => array('it_IT'),
219                  'sv' => array('sv_SE'),
220                  'ja.utf-8'  => array('ja_JP','ja_JP.utf-8','japanese'),
221                  'ja.euc-jp' => array('ja_JP','ja_JP.eucJP','japanese.euc'),
222                  'zh' => array('zh_TW', 'zh_CN'),
223                  );
224     if (!$locale or $locale=='C') { 
225         // do the reverse: return the detected locale collapsed to our LANG
226         $locale = setlocale($category, '');
227         if ($locale) {
228             if (strstr($locale, '_')) list ($lang) = split('_', $locale);
229             else $lang = $locale;
230             if (strlen($lang) > 2) { 
231                 foreach ($alt as $try => $locs) {
232                     if (in_array($locale, $locs) or in_array($lang, $locs)) {
233                         //if (empty($GLOBALS['LANG'])) $GLOBALS['LANG'] = $try;
234                         return $try;
235                     }
236                 }
237             }
238         }
239     }
240     if (strlen($locale) == 2)
241         $lang = $locale;
242     else 
243         list ($lang) = split('_', $locale);
244     if (!isset($alt[$lang]))
245         return false;
246         
247     foreach ($alt[$lang] as $try) {
248         if ($res = setlocale($category, $try))
249             return $res;
250         // Try with charset appended...
251         $try = $try . '.' . $GLOBALS['charset'];
252         if ($res = setlocale($category, $try))
253             return $res;
254         foreach (array(".", '@', '_') as $sep) {
255             if ($i = strpos($try, $sep)) {
256                 $try = substr($try, 0, $i);
257                 if (($res = setlocale($category, $try)))
258                     return $res;
259             }
260         }
261     }
262     return false;
263     // A standard locale name is typically of  the  form
264     // language[_territory][.codeset][@modifier],  where  language is
265     // an ISO 639 language code, territory is an ISO 3166 country code,
266     // and codeset  is  a  character  set or encoding identifier like
267     // ISO-8859-1 or UTF-8.
268 }
269
270 // [99ms]
271 function update_locale($loc) {
272     // $LANG or DEFAULT_LANGUAGE is too less information, at least on unix for
273     // setlocale(), for bindtextdomain() to succeed.
274     $setlocale = guessing_setlocale(LC_ALL, $loc); // [56ms]
275     if (!$setlocale) { // system has no locale for this language, so gettext might fail
276         $setlocale = FileFinder::_get_lang();
277         list ($setlocale,) = split('_', $setlocale, 2);
278         $setlocale = guessing_setlocale(LC_ALL, $setlocale); // try again
279         if (!$setlocale) $setlocale = $loc;
280     }
281     // Try to put new locale into environment (so any
282     // programs we run will get the right locale.)
283     if (!function_exists('bindtextdomain'))  {
284         // Reinitialize translation array.
285         global $locale;
286         $locale = array();
287         // do reinit to purge PHP's static cache [43ms]
288         if ( ($lcfile = FindLocalizedFile("LC_MESSAGES/phpwiki.php", 'missing_ok', 'reinit')) ) {
289             include($lcfile);
290         }
291     } else {
292         // If PHP is in safe mode, this is not allowed,
293         // so hide errors...
294         @putenv("LC_ALL=$setlocale");
295         @putenv("LANG=$loc");
296         @putenv("LANGUAGE=$loc");
297     }
298
299     // To get the POSIX character classes in the PCRE's (e.g.
300     // [[:upper:]]) to match extended characters (e.g. GrüßGott), we have
301     // to set the locale, using setlocale().
302     //
303     // The problem is which locale to set?  We would like to recognize all
304     // upper-case characters in the iso-8859-1 character set as upper-case
305     // characters --- not just the ones which are in the current $LANG.
306     //
307     // As it turns out, at least on my system (Linux/glibc-2.2) as long as
308     // you setlocale() to anything but "C" it works fine.  (I'm not sure
309     // whether this is how it's supposed to be, or whether this is a bug
310     // in the libc...)
311     //
312     // We don't currently use the locale setting for anything else, so for
313     // now, just set the locale to US English.
314     //
315     // FIXME: Not all environments may support en_US?  We should probably
316     // have a list of locales to try.
317     if (setlocale(LC_CTYPE, 0) == 'C') {
318         $x = setlocale(LC_CTYPE, 'en_US.' . $GLOBALS['charset']);
319     } else {
320         $x = setlocale(LC_CTYPE, $setlocale);
321     }
322
323     return $loc;
324 }
325
326 /** string pcre_fix_posix_classes (string $regexp)
327 *
328 * Older version (pre 3.x?) of the PCRE library do not support
329 * POSIX named character classes (e.g. [[:alnum:]]).
330 *
331 * This is a helper function which can be used to convert a regexp
332 * which contains POSIX named character classes to one that doesn't.
333 *
334 * All instances of strings like '[:<class>:]' are replaced by the equivalent
335 * enumerated character class.
336 *
337 * Implementation Notes:
338 *
339 * Currently we use hard-coded values which are valid only for
340 * ISO-8859-1.  Also, currently on the classes [:alpha:], [:alnum:],
341 * [:upper:] and [:lower:] are implemented.  (The missing classes:
342 * [:blank:], [:cntrl:], [:digit:], [:graph:], [:print:], [:punct:],
343 * [:space:], and [:xdigit:] could easily be added if needed.)
344 *
345 * This is a hack.  I tried to generate these classes automatically
346 * using ereg(), but discovered that in my PHP, at least, ereg() is
347 * slightly broken w.r.t. POSIX character classes.  (It includes
348 * "\xaa" and "\xba" in [:alpha:].)
349 *
350 * So for now, this will do.  --Jeff <dairiki@dairiki.org> 14 Mar, 2001
351 */
352 function pcre_fix_posix_classes ($regexp) {
353     global $charset;
354     if (!isset($charset))
355         $charset = CHARSET; // get rid of constant. pref is dynamic and language specific
356     if (in_array($GLOBALS['LANG'], array('zh')))
357         $charset = 'utf-8';
358     if (strstr($GLOBALS['LANG'],'.utf-8'))
359         $charset = 'utf-8';
360     elseif (strstr($GLOBALS['LANG'],'.euc-jp'))
361         $charset = 'euc-jp';
362     elseif (in_array($GLOBALS['LANG'], array('ja')))
363         //$charset = 'utf-8';
364         $charset = 'euc-jp';
365
366     if (strtolower($charset) == 'utf-8') { // thanks to John McPherson
367         // until posix class names/pcre work with utf-8
368         if (preg_match('/[[:upper:]]/', '\xc4\x80'))
369             return $regexp;    
370         // utf-8 non-ascii chars: most common (eg western) latin chars are 0xc380-0xc3bf
371         // we currently ignore other less common non-ascii characters
372         // (eg central/east european) latin chars are 0xc432-0xcdbf and 0xc580-0xc5be
373         // and indian/cyrillic/asian languages
374         
375         // this replaces [[:lower:]] with utf-8 match (Latin only)
376         $regexp = preg_replace('/\[\[\:lower\:\]\]/','(?:[a-z]|\xc3[\x9f-\xbf]|\xc4[\x81\x83\x85\x87])',
377                                $regexp);
378         // this replaces [[:upper:]] with utf-8 match (Latin only)
379         $regexp = preg_replace('/\[\[\:upper\:\]\]/','(?:[A-Z]|\xc3[\x80-\x9e]|\xc4[\x80\x82\x84\x86])',
380                                $regexp);
381     } elseif (preg_match('/[[:upper:]]/', 'Ä')) {
382         // First check to see if our PCRE lib supports POSIX character
383         // classes.  If it does, there's nothing to do.
384         return $regexp;
385     }
386     static $classes = array(
387                             'alnum' => "0-9A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff",
388                             'alpha' => "A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\xff",
389                             'upper' => "A-Z\xc0-\xd6\xd8-\xde",
390                             'lower' => "a-z\xdf-\xf6\xf8-\xff"
391                             );
392     $keys = join('|', array_keys($classes));
393     return preg_replace("/\[:($keys):]/e", '$classes["\1"]', $regexp);
394 }
395
396 function deduce_script_name() {
397     $s = &$GLOBALS['HTTP_SERVER_VARS'];
398     $script = @$s['SCRIPT_NAME'];
399     if (empty($script) or $script[0] != '/') {
400         // Some places (e.g. Lycos) only supply a relative name in
401         // SCRIPT_NAME, but give what we really want in SCRIPT_URL.
402         if (!empty($s['SCRIPT_URL']))
403             $script = $s['SCRIPT_URL'];
404     }
405     return $script;
406 }
407
408 function IsProbablyRedirectToIndex () {
409     // This might be a redirect to the DirectoryIndex,
410     // e.g. REQUEST_URI = /dir/?some_action got redirected
411     // to SCRIPT_NAME = /dir/index.php
412
413     // In this case, the proper virtual path is still
414     // $SCRIPT_NAME, since pages appear at
415     // e.g. /dir/index.php/HomePage.
416
417     $requri = preg_replace('/\?.*$/','',$GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']);
418     $requri = preg_quote($requri, '%');
419     return preg_match("%^${requri}[^/]*$%", $GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']);
420 }
421
422 // >= php-4.1.0
423 if (!function_exists('array_key_exists')) { // lib/IniConfig.php, sqlite, adodb, ...
424     function array_key_exists($item, $array) {
425         return isset($array[$item]);
426     }
427 }
428
429 // => php-4.0.5
430 if (!function_exists('is_scalar')) { // lib/stdlib.php:wikihash()
431     function is_scalar($x) {
432         return is_numeric($x) or is_string($x) or is_float($x) or is_bool($x); 
433     }
434 }
435
436 // => php-4.2.0. pear wants to break old php's! DB uses it now.
437 if (!function_exists('is_a')) {
438     function is_a($item,$class) {
439         return isa($item,$class); 
440     }
441 }
442
443 // needed < php5
444 // by bradhuizenga at softhome dot net from the php docs
445 if (!function_exists('str_ireplace')) {
446   function str_ireplace($find, $replace, $string) {
447       if (!is_array($find)) $find = array($find);
448       if (!is_array($replace)) {
449           if (!is_array($find)) 
450               $replace = array($replace);
451           else {
452               // this will duplicate the string into an array the size of $find
453               $c = count($find);
454               $rString = $replace;
455               unset($replace);
456               for ($i = 0; $i < $c; $i++) {
457                   $replace[$i] = $rString;
458               }
459           }
460       }
461       foreach ($find as $fKey => $fItem) {
462           $between = explode(strtolower($fItem),strtolower($string));
463           $pos = 0;
464           foreach ($between as $bKey => $bItem) {
465               $between[$bKey] = substr($string,$pos,strlen($bItem));
466               $pos += strlen($bItem) + strlen($fItem);
467           }
468           $string = implode($replace[$fKey], $between);
469       }
470       return($string);
471   }
472 }
473
474 /**
475  * safe php4 definition for clone.
476  * php5 copies objects by reference, but we need to clone "deep copy" in some places.
477  * (BlockParser)
478  * We need to eval it as workaround for the php5 parser.
479  * See http://www.acko.net/node/54
480  */
481 if (!check_php_version(5)) {
482     eval('
483     function clone($object) {
484       return $object;
485     }
486     ');
487 }
488
489 /** 
490  * wordwrap() might crash between 4.1.2 and php-4.3.0RC2, fixed in 4.3.0
491  * See http://bugs.php.net/bug.php?id=20927 and 
492  * http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-1396
493  * Improved version of wordwrap2() in the comments at http://www.php.net/wordwrap
494  */
495 function safe_wordwrap($str, $width=80, $break="\n", $cut=false) {
496     if (check_php_version(4,3))
497         return wordwrap($str, $width, $break, $cut);
498     elseif (!check_php_version(4,1,2))
499         return wordwrap($str, $width, $break, $cut);
500     else {
501         $len = strlen($str);
502         $tag = 0; $result = ''; $wordlen = 0;
503         for ($i = 0; $i < $len; $i++) {
504             $chr = $str[$i];
505             // don't break inside xml tags
506             if ($chr == '<') {
507                 $tag++;
508             } elseif ($chr == '>') {
509                 $tag--;
510             } elseif (!$tag) {
511                 if (!function_exists('ctype_space')) {
512                     if (preg_match('/^\s$/', $chr))
513                         $wordlen = 0;
514                     else
515                         $wordlen++;
516                 }
517                 elseif (ctype_space($chr)) {
518                     $wordlen = 0;
519                 } else {
520                     $wordlen++;
521                 }
522             }
523             if ((!$tag) && ($wordlen) && (!($wordlen % $width))) {
524                 $chr .= $break;
525             }
526             $result .= $chr;
527         }
528         return $result;
529         /*
530         if (isset($str) && isset($width)) {
531             $ex = explode(" ", $str); // wrong: must use preg_split \s+
532             $rp = array();
533             for ($i=0; $i<count($ex); $i++) {
534                 // $word_array = preg_split('//', $ex[$i], -1, PREG_SPLIT_NO_EMPTY);
535                 // delete #&& !is_numeric($ex[$i])# if you want force it anyway
536                 if (strlen($ex[$i]) > $width && !is_numeric($ex[$i])) {
537                     $where = 0;
538                     $rp[$i] = "";
539                     for($b=0; $b < (ceil(strlen($ex[$i]) / $width)); $b++) {
540                         $rp[$i] .= substr($ex[$i], $where, $width).$break;
541                         $where += $width;
542                     }
543                 } else {
544                     $rp[$i] = $ex[$i];
545                 }
546             }
547             return implode(" ",$rp);
548         }
549         return $text;
550         */
551     }
552 }
553
554 function getUploadFilePath() {
555     return defined('PHPWIKI_DIR') 
556         ? PHPWIKI_DIR . "/uploads/" 
557         : realpath(dirname(__FILE__) . "/../uploads/");
558 }
559 function getUploadDataPath() {
560   return SERVER_URL . ((substr(DATA_PATH,0,1)=='/') ? '' : "/") . DATA_PATH . '/uploads/';
561 }
562
563 // $Log: not supported by cvs2svn $
564 // Revision 1.138  2006/03/07 20:45:43  rurban
565 // wikihash for php-5.1
566 //
567 // Revision 1.137  2005/08/06 14:31:10  rurban
568 // ensure absolute uploads path
569 //
570 // Revision 1.136  2005/05/06 16:49:24  rurban
571 // Safari comment
572 //
573 // Revision 1.135  2005/04/01 15:22:20  rurban
574 // Implement icase and regex options.
575 // Change checkbox case message from "Case-Sensitive" to "Case-Insensitive"
576 //
577 // Revision 1.134  2005/03/27 18:23:39  rurban
578 // compute locale only for setlocale and LC_ALL
579 //
580 // Revision 1.133  2005/02/08 13:26:59  rurban
581 //  improve the locale splitter
582 //
583 // Revision 1.132  2005/02/07 15:39:02  rurban
584 // another locale fix
585 //
586 // Revision 1.131  2005/02/05 15:32:09  rurban
587 // force guessing_setlocale (again)
588 //
589 // Revision 1.130  2005/01/29 20:36:44  rurban
590 // very important php5 fix! clone objects
591 //
592 // Revision 1.129  2005/01/08 22:53:50  rurban
593 // hardcode list of langs (file access is slow)
594 // fix client detection
595 // set proper locale on empty locale
596 //
597 // Revision 1.128  2005/01/04 20:22:46  rurban
598 // guess $LANG based on client
599 //
600 // Revision 1.127  2004/12/26 17:15:32  rurban
601 // new reverse locale detection on DEFAULT_LANGUAGE="", ja default euc-jp again
602 //
603 // Revision 1.126  2004/12/20 16:05:00  rurban
604 // gettext msg unification
605 //
606 // Revision 1.125  2004/11/21 11:59:18  rurban
607 // remove final \n to be ob_cache independent
608 //
609 // Revision 1.124  2004/11/09 17:11:16  rurban
610 // * revert to the wikidb ref passing. there's no memory abuse there.
611 // * use new wikidb->_cache->_id_cache[] instead of wikidb->_iwpcache, to effectively
612 //   store page ids with getPageLinks (GleanDescription) of all existing pages, which
613 //   are also needed at the rendering for linkExistingWikiWord().
614 //   pass options to pageiterator.
615 //   use this cache also for _get_pageid()
616 //   This saves about 8 SELECT count per page (num all pagelinks).
617 // * fix passing of all page fields to the pageiterator.
618 // * fix overlarge session data which got broken with the latest ACCESS_LOG_SQL changes
619 //
620 // Revision 1.123  2004/11/05 21:03:27  rurban
621 // new DEBUG flag: _DEBUG_LOGIN (64)
622 //   verbose login debug-msg (settings and reason for failure)
623 //
624 // Revision 1.122  2004/10/14 17:49:58  rurban
625 // fix warning in safe_wordwrap
626 //
627 // Revision 1.121  2004/10/14 17:48:19  rurban
628 // typo in safe_wordwrap
629 //
630 // Revision 1.120  2004/09/22 13:46:26  rurban
631 // centralize upload paths.
632 // major WikiPluginCached feature enhancement:
633 //   support _STATIC pages in uploads/ instead of dynamic getimg.php? subrequests.
634 //   mainly for debugging, cache problems and action=pdf
635 //
636 // Revision 1.119  2004/09/16 07:50:37  rurban
637 // wordwrap() might crash between 4.1.2 and php-4.3.0RC2, fixed in 4.3.0
638 // See http://bugs.php.net/bug.php?id=20927 and
639 //     http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2002-1396
640 // Improved version of wordwrap2() from the comments at http://www.php.net/wordwrap
641 //
642 // Revision 1.118  2004/07/13 14:03:31  rurban
643 // just some comments
644 //
645 // Revision 1.117  2004/06/21 17:29:17  rurban
646 // pear DB introduced a is_a requirement. so pear lost support for php < 4.2.0
647 //
648 // Revision 1.116  2004/06/21 08:39:37  rurban
649 // pear/Cache update from Cache-1.5.4 (added db and trifile container)
650 // pear/DB update from DB-1.6.1 (mysql bugfixes, php5 compat, DB_PORTABILITY features)
651 //
652 // Revision 1.115  2004/06/20 14:42:54  rurban
653 // various php5 fixes (still broken at blockparser)
654 //
655 // Revision 1.114  2004/06/19 11:48:05  rurban
656 // moved version check forwards: already needed in XmlElement::_quote
657 //
658 // Revision 1.113  2004/06/03 12:59:41  rurban
659 // simplify translation
660 // NS4 wrap=virtual only
661 //
662 // Revision 1.112  2004/06/02 18:01:46  rurban
663 // init global FileFinder to add proper include paths at startup
664 //   adds PHPWIKI_DIR if started from another dir, lib/pear also
665 // fix slashify for Windows
666 // fix USER_AUTH_POLICY=old, use only USER_AUTH_ORDER methods (besides HttpAuth)
667 //
668 // Revision 1.111  2004/05/17 17:43:29  rurban
669 // CGI: no PATH_INFO fix
670 //
671 // Revision 1.110  2004/05/16 23:10:44  rurban
672 // update_locale wrongly resetted LANG, which broke japanese.
673 // japanese now correctly uses EUC_JP, not utf-8.
674 // more charset and lang headers to help the browser.
675 //
676 // Revision 1.109  2004/05/08 14:06:12  rurban
677 // new support for inlined image attributes: [image.jpg size=50x30 align=right]
678 // minor stability and portability fixes
679 //
680 // Revision 1.108  2004/05/08 11:25:16  rurban
681 // php-4.0.4 fixes
682 //
683 // Revision 1.107  2004/05/06 17:30:38  rurban
684 // CategoryGroup: oops, dos2unix eol
685 // improved phpwiki_version:
686 //   pre -= .0001 (1.3.10pre: 1030.099)
687 //   -p1 += .001 (1.3.9-p1: 1030.091)
688 // improved InstallTable for mysql and generic SQL versions and all newer tables so far.
689 // abstracted more ADODB/PearDB methods for action=upgrade stuff:
690 //   backend->backendType(), backend->database(),
691 //   backend->listOfFields(),
692 //   backend->listOfTables(),
693 //
694 // Revision 1.106  2004/05/02 19:12:14  rurban
695 // fix sf.net bug #945154 Konqueror alt css
696 //
697 // Revision 1.105  2004/05/02 15:10:06  rurban
698 // new finally reliable way to detect if /index.php is called directly
699 //   and if to include lib/main.php
700 // new global AllActionPages
701 // SetupWiki now loads all mandatory pages: HOME_PAGE, action pages, and warns if not.
702 // WikiTranslation what=buttons for Carsten to create the missing MacOSX buttons
703 // PageGroupTestOne => subpages
704 // renamed PhpWikiRss to PhpWikiRecentChanges
705 // more docs, default configs, ...
706 //
707 // Revision 1.104  2004/05/01 11:26:37  rurban
708 // php-4.0.x support: array_key_exists (PHP 4 >= 4.1.0)
709 //
710 // Revision 1.103  2004/04/30 00:04:14  rurban
711 // zh (chinese language) support
712 //
713 // Revision 1.102  2004/04/29 23:25:12  rurban
714 // re-ordered locale init (as in 1.3.9)
715 // fixed loadfile with subpages, and merge/restore anyway
716 //   (sf.net bug #844188)
717 //
718 // Revision 1.101  2004/04/26 13:22:32  rurban
719 // calculate bool old or dynamic constants later
720 //
721 // Revision 1.100  2004/04/26 12:15:01  rurban
722 // check default config values
723 //
724 // Revision 1.99  2004/04/21 14:04:24  zorloc
725 // 'Require lib/FileFinder.php' necessary to allow for call to FindLocalizedFile().
726 //
727 // Revision 1.98  2004/04/20 18:10:28  rurban
728 // config refactoring:
729 //   FileFinder is needed for WikiFarm scripts calling index.php
730 //   config run-time calls moved to lib/IniConfig.php:fix_configs()
731 //   added PHPWIKI_DIR smart-detection code (Theme finder)
732 //   moved FileFind to lib/FileFinder.php
733 //   cleaned lib/config.php
734 //
735 // Revision 1.97  2004/04/18 01:11:52  rurban
736 // more numeric pagename fixes.
737 // fixed action=upload with merge conflict warnings.
738 // charset changed from constant to global (dynamic utf-8 switching)
739 //
740
741 // For emacs users
742 // Local Variables:
743 // mode: php
744 // tab-width: 8
745 // c-basic-offset: 4
746 // c-hanging-comment-ender-p: nil
747 // indent-tabs-mode: nil
748 // End:
749 ?>