1 | <?php |
---|
2 | /** |
---|
3 | * @copyright 2005-2006 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 | define('OPENPNE_REGIST_FROM_NONE' , 0); // 新規登録不可 |
---|
34 | define('OPENPNE_REGIST_FROM_PC' , 1); // PCからのみ登録可 |
---|
35 | define('OPENPNE_REGIST_FROM_KTAI' , 2); // 携帯からのみ登録可 |
---|
36 | define('OPENPNE_REGIST_FROM_PCKTAI', 3); // PC携帯から登録可 |
---|
37 | |
---|
38 | // 携帯メールのドメイン名 |
---|
39 | $GLOBALS['OpenPNE']['KTAI_DOMAINS'] = array( |
---|
40 | 'docomo.ne.jp', |
---|
41 | 'ezweb.ne.jp', |
---|
42 | 'softbank.ne.jp', |
---|
43 | 'd.vodafone.ne.jp', |
---|
44 | 'h.vodafone.ne.jp', |
---|
45 | 't.vodafone.ne.jp', |
---|
46 | 'c.vodafone.ne.jp', |
---|
47 | 'r.vodafone.ne.jp', |
---|
48 | 'k.vodafone.ne.jp', |
---|
49 | 'n.vodafone.ne.jp', |
---|
50 | 'q.vodafone.ne.jp', |
---|
51 | 's.vodafone.ne.jp', |
---|
52 | 'pdx.ne.jp', |
---|
53 | 'di.pdx.ne.jp', |
---|
54 | 'dj.pdx.ne.jp', |
---|
55 | 'dk.pdx.ne.jp', |
---|
56 | 'wm.pdx.ne.jp', |
---|
57 | ); |
---|
58 | |
---|
59 | // Smarty の設定 |
---|
60 | $GLOBALS['SMARTY'] = (array)$GLOBALS['SMARTY'] + array( |
---|
61 | 'template_dir' => OPENPNE_WEBAPP_DIR . '/templates/', |
---|
62 | 'compile_dir' => OPENPNE_VAR_DIR . '/templates_c/', |
---|
63 | 'left_delimiter' => '({', |
---|
64 | 'right_delimiter' => '})', |
---|
65 | 'caching' => false, |
---|
66 | 'debugging' => false, |
---|
67 | 'debug_tpl' => OPENPNE_WEBAPP_DIR . '/templates/debug.tpl', |
---|
68 | 'default_modifiers' => array('@t_escape'), |
---|
69 | 'error_reporting' => E_ALL ^ E_NOTICE, |
---|
70 | ); |
---|
71 | $GLOBALS['SMARTY']['plugins_dir'] = array( |
---|
72 | OPENPNE_WEBAPP_DIR . '/lib/smarty_plugins/', |
---|
73 | OPENPNE_LIB_DIR . '/smarty_plugins/', |
---|
74 | 'plugins' |
---|
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 | // cookie 設定 |
---|
92 | ini_set('session.use_cookies', '1'); |
---|
93 | ini_set('session.use_only_cookies', '1'); |
---|
94 | |
---|
95 | // セッション情報をDBに保存 |
---|
96 | OpenPNE_Auth::set_session_save_handler(); |
---|
97 | |
---|
98 | // magic_quotes_gpc = On の場合の対策 |
---|
99 | if (get_magic_quotes_gpc()) { |
---|
100 | function strip_magic_slashes($arr) |
---|
101 | { |
---|
102 | return is_array($arr) ? |
---|
103 | array_map('strip_magic_slashes', $arr) : |
---|
104 | stripslashes($arr); |
---|
105 | } |
---|
106 | |
---|
107 | $_GET = strip_magic_slashes($_GET); |
---|
108 | $_POST = strip_magic_slashes($_POST); |
---|
109 | $_REQUEST = strip_magic_slashes($_REQUEST); |
---|
110 | } |
---|
111 | |
---|
112 | isset($GLOBALS['OpenPNE']['common']['session_lifetime']) |
---|
113 | or $GLOBALS['OpenPNE']['common']['session_lifetime'] = 0; |
---|
114 | isset($GLOBALS['OpenPNE']['common']['session_idletime']) |
---|
115 | or $GLOBALS['OpenPNE']['common']['session_idletime'] = 0; |
---|
116 | |
---|
117 | ini_set('arg_separator.output', '&'); |
---|
118 | |
---|
119 | ?> |
---|