requireInitialConfig(); $this->defineDSN(); $this->setErrorReporting(); $this->defineConstants(); $this->mbstringInit(); $this->createCacheDir(); } /** * 初期設定ファイルを読み込む. * * @access protected * @return void */ function requireInitialConfig() { require_once(realpath(dirname( __FILE__)) ."/../install.php"); } /** * DSN を定義する. * * @access protected * @return void */ function defineDSN() { if(defined('DB_TYPE') && defined('DB_USER') && defined('DB_PASSWORD') && defined('DB_SERVER') && defined('DB_PORT') && defined('DB_NAME')) { /** サイト用DB */ define ("DEFAULT_DSN", DB_TYPE . "://" . DB_USER . ":" . DB_PASSWORD . "@" . DB_SERVER . ":" .DB_PORT . "/" . DB_NAME); } else { define("DEFAULT_DSN", "pgsql://nobody:password@localhost:5432/eccubedb"); } } /** * エラーレベル設定を行う. * * ・推奨値 * 開発時 - E_ALL * 運用時 - E_ALL & ~E_NOTICE * * @access protected * @return void */ function setErrorReporting() { error_reporting(E_ALL & ~E_NOTICE); } /** * マルチバイト文字列設定を行う. * * TODO SJIS-win や, eucJP-win への対応 * * @access protected * @return void */ function mbstringInit() { ini_set("mbstring.http_input", CHAR_CODE); ini_set("mbstring.http_output", CHAR_CODE); ini_set("auto_detect_line_endings", 1); ini_set("default_charset", CHAR_CODE); ini_set("mbstring.internal_encoding", CHAR_CODE); ini_set("mbstring.detect_order", "auto"); ini_set("mbstring.substitute_character", "none"); //ロケールを明示的に設定 setlocale(LC_ALL, LOCALE); } /** * 定数を設定する. * * mtb_constants.php を読み込んで定数を設定する. * キャッシュディレクトリに存在しない場合は, 初期データからコピーする. * * @access protected * @return void */ function defineConstants() { $errorMessage = "