#03 アプリケーションの設定とコントローラの設定:Ethnaを使ったフツーの掲示板まとめ
で、次にアプリケーションの設定をします。
- etc/bbs-ini.php
<?php $config = array( 'url' => 'http://192.168.11.50/project/ethnabbs/', 'debug' => true, 'dsn' => 'mysql://username:password@localhost/tablename', 'log_facility' => 'file', 'log_level' => 'debug', 'log_option' => 'pid,function,pos', 'log_filter_do' => '', 'log_filter_ignore' => 'Undefined index.*%%.*tpl', 'file' => array( 'level' => 'debug', 'file' => '/var/www/ethnabbs/log/bbs.log', 'mode' => 0666, ), ...
- app/Bbs_Controller.php
後にレンタルサーバで動かす際の設定。「BASE . lib/」にEthnaやPEARを突っ込んでしまう場合は下記の設定を。
-
- 16行目あたりにある ini_set('include_path', ...);
- ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . implode(PATH_SEPARATOR, array($app, $lib))); + ini_set('include_path', implode(PATH_SEPARATOR, array($app, $lib)) . PATH_SEPARATOR . ini_get('include_path'));
include_pathの後のほうにあるファイルを読み込もうとすると著しくパフォーマンスが落ちるらしいからです。。
それから、これも、ココでいいのかわからないけど、その次あたりに追加しておきます。ホントはutf-8でやろうと思いましたが、やめました(笑)次はutfでやります。
<?php ... header("Content-Type: text/html; charset=euc-jp");