1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2007 OpenPNE Project |
---|
4 | * @license http://www.php.net/license/3_01.txt PHP License 3.01 |
---|
5 | */ |
---|
6 | |
---|
7 | // 画像サーバの場合は強制リダイレクト |
---|
8 | if (defined('OPENPNE_IS_IMG_SERVER') && OPENPNE_IS_IMG_SERVER) { |
---|
9 | header('Location: ' . OPENPNE_URL); |
---|
10 | exit; |
---|
11 | } |
---|
12 | |
---|
13 | /** |
---|
14 | * 共通の初期化処理 |
---|
15 | */ |
---|
16 | // バージョン番号の取得 |
---|
17 | include_once OPENPNE_WEBAPP_DIR . '/version.php'; |
---|
18 | |
---|
19 | // include_path の設定 |
---|
20 | include_once OPENPNE_LIB_DIR . '/include/PHP/Compat/Constant/PATH_SEPARATOR.php'; |
---|
21 | $include_paths = array( |
---|
22 | OPENPNE_LIB_DIR . '/include', |
---|
23 | OPENPNE_WEBAPP_DIR . '/lib', |
---|
24 | ini_get('include_path') |
---|
25 | ); |
---|
26 | ini_set('include_path', implode(PATH_SEPARATOR, $include_paths)); |
---|
27 | |
---|
28 | // 定数定義 |
---|
29 | include_once 'PHP/Compat/Constant/UPLOAD_ERR.php'; |
---|
30 | include_once 'PHP/Compat/Function/image_type_to_mime_type.php'; |
---|
31 | |
---|
32 | // 携帯メールのドメイン名 |
---|
33 | $GLOBALS['OpenPNE']['KTAI_DOMAINS'] = array( |
---|
34 | 'docomo.ne.jp', |
---|
35 | 'ezweb.ne.jp', |
---|
36 | 'softbank.ne.jp', |
---|
37 | 'd.vodafone.ne.jp', |
---|
38 | 'h.vodafone.ne.jp', |
---|
39 | 't.vodafone.ne.jp', |
---|
40 | 'c.vodafone.ne.jp', |
---|
41 | 'r.vodafone.ne.jp', |
---|
42 | 'k.vodafone.ne.jp', |
---|
43 | 'n.vodafone.ne.jp', |
---|
44 | 'q.vodafone.ne.jp', |
---|
45 | 's.vodafone.ne.jp', |
---|
46 | 'pdx.ne.jp', |
---|
47 | 'di.pdx.ne.jp', |
---|
48 | 'dj.pdx.ne.jp', |
---|
49 | 'dk.pdx.ne.jp', |
---|
50 | 'wm.pdx.ne.jp', |
---|
51 | ); |
---|
52 | |
---|
53 | // Smarty の設定 |
---|
54 | $GLOBALS['SMARTY'] = (array)$GLOBALS['SMARTY'] + array( |
---|
55 | 'template_dir' => OPENPNE_WEBAPP_DIR . '/templates/', |
---|
56 | 'compile_dir' => OPENPNE_VAR_DIR . '/templates_c/', |
---|
57 | 'left_delimiter' => '({', |
---|
58 | 'right_delimiter' => '})', |
---|
59 | 'caching' => false, |
---|
60 | 'debugging' => false, |
---|
61 | 'debug_tpl' => OPENPNE_WEBAPP_DIR . '/templates/debug.tpl', |
---|
62 | 'default_modifiers' => array('@t_escape'), |
---|
63 | 'error_reporting' => E_ALL ^ E_NOTICE, |
---|
64 | ); |
---|
65 | $GLOBALS['SMARTY']['plugins_dir'] = array( |
---|
66 | OPENPNE_WEBAPP_DIR . '/lib/smarty_plugins/', |
---|
67 | OPENPNE_LIB_DIR . '/smarty_plugins/', |
---|
68 | 'plugins' |
---|
69 | ); |
---|
70 | |
---|
71 | // 外部認証の場合は招待・新規登録はできない |
---|
72 | if (defined('IS_SLAVEPNE') && IS_SLAVEPNE) { |
---|
73 | define('IS_USER_INVITE', false); |
---|
74 | define('IS_CLOSED_SNS', true); |
---|
75 | } |
---|
76 | |
---|
77 | // ライブラリ読み込み |
---|
78 | require_once 'util.inc.php'; |
---|
79 | require_once 'db.inc.php'; |
---|
80 | require_once 'controller.php'; |
---|
81 | require_once 'OpenPNE/Smarty.php'; |
---|
82 | require_once 'OpenPNE/Auth.php'; |
---|
83 | |
---|
84 | require_once 'OpenPNE/Config.php'; |
---|
85 | // DBから設定読み込み |
---|
86 | $config =& OpenPNE_Config::getInstance(); |
---|
87 | $config->db_load_config(); |
---|
88 | // 設定のデフォルト値を適用 |
---|
89 | $config->bind_default(); |
---|
90 | |
---|
91 | // session/cookie 設定 |
---|
92 | ini_set('session.use_cookies', '1'); |
---|
93 | ini_set('session.use_only_cookies', '1'); |
---|
94 | |
---|
95 | $url = parse_url(OPENPNE_URL); |
---|
96 | if (substr($url['path'], -1) != '/') { |
---|
97 | $url['path'] .= '/'; |
---|
98 | } |
---|
99 | ini_set('session.cookie_path', $url['path']); |
---|
100 | |
---|
101 | OpenPNE_Auth::set_session_save_handler(); |
---|
102 | |
---|
103 | // magic_quotes_gpc = On の場合の対策 |
---|
104 | if (get_magic_quotes_gpc()) { |
---|
105 | function strip_magic_slashes($arr) |
---|
106 | { |
---|
107 | return is_array($arr) ? |
---|
108 | array_map('strip_magic_slashes', $arr) : |
---|
109 | stripslashes($arr); |
---|
110 | } |
---|
111 | |
---|
112 | $_GET = strip_magic_slashes($_GET); |
---|
113 | $_POST = strip_magic_slashes($_POST); |
---|
114 | $_REQUEST = strip_magic_slashes($_REQUEST); |
---|
115 | } |
---|
116 | |
---|
117 | // http_build_query() |
---|
118 | ini_set('arg_separator.output', '&'); |
---|
119 | include_once 'PHP/Compat/Function/http_build_query.php'; |
---|
120 | |
---|
121 | ?> |
---|