• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

PukiWiki


Commit MetaInfo

Revisione093d27103ed3b5b0195fcc1dc9578bf654fb8af (tree)
Time2016-02-13 01:08:32
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack2/382 Confile setting variables to a function

Change Summary

Incremental Difference

--- a/lib/init.php
+++ b/lib/init.php
@@ -53,12 +53,90 @@ define('MUTIME', getmicrotime());
5353 /////////////////////////////////////////////////
5454 // Require INI_FILE
5555
56+function initialize_settings() {
57+ require(INI_FILE);
58+ $vars = array(
59+'page_title',
60+'modifier',
61+'modifierlink',
62+'defaultpage',
63+'whatsnew',
64+'whatsdeleted',
65+'interwiki',
66+'menubar',
67+'nofollow',
68+'nowikiname',
69+'autolink',
70+'function_freeze',
71+'notimeupdate',
72+'adminpass',
73+'pagereading_enable',
74+'pagereading_kanji2kana_converter',
75+'pagereading_kanji2kana_encoding',
76+'pagereading_chasen_path',
77+'pagereading_kakasi_path',
78+'pagereading_config_page',
79+'pagereading_config_dict',
80+'auth_users',
81+'auth_groups',
82+'auth_method_type',
83+'read_auth',
84+'read_auth_pages',
85+'edit_auth',
86+'edit_auth_pages',
87+'search_auth',
88+'ldap_user_account',
89+'maxshow',
90+'maxshow_deleted',
91+'cantedit',
92+'lastmod',
93+'date_format',
94+'time_format',
95+'rss_max',
96+'do_backup',
97+'del_backup',
98+'cycle',
99+'maxage',
100+'use_proxy',
101+'proxy_host',
102+'proxy_port',
103+'need_proxy_auth',
104+'proxy_auth_user',
105+'proxy_auth_pass',
106+'no_proxy',
107+'notify',
108+'notify_diff_only',
109+'smtp_server',
110+'notify_to',
111+'notify_from',
112+'notify_subject',
113+'notify_header',
114+'smtp_auth',
115+'pop_server',
116+'pop_port',
117+'pop_userid',
118+'pop_passwd',
119+'non_list',
120+'search_non_list',
121+'auto_template_func',
122+'auto_template_rules',
123+'fixed_heading_anchor',
124+'preformat_ltrim',
125+'line_break',
126+'usedatetime',
127+'agents');
128+
129+ foreach($vars as $varname) {
130+ $GLOBALS[$varname] = ${$varname};
131+ }
132+}
133+
56134 define('INI_FILE', DATA_HOME . 'pukiwiki.ini.php');
57135 $die = '';
58136 if (! file_exists(INI_FILE) || ! is_readable(INI_FILE)) {
59137 $die .= 'File is not found. (INI_FILE)' . "\n";
60138 } else {
61- require(INI_FILE);
139+ initialize_settings();
62140 }
63141 if ($die) die_message(nl2br("\n\n" . $die));
64142