Source for file Config.php
Documentation is available at Config.php
// vim: foldmethod=marker
* @author Masaki Fujimoto <fujimoto@php.net>
* @license http://www.opensource.org/licenses/bsd-license.php The BSD License
* @version $Id: f48b583e876f0809c6ff9980349bc3924464a40c $
* @author Masaki Fujimoto <fujimoto@php.net>
/** @protected object Ethna_Controller controllerオブジェクト */
/** @FIXME @protected array 設定内容 */
* Ethna_Configクラスのコンストラクタ
* @param object Ethna_Controller $controller controllerオブジェクト
$r =
$this->_getConfig();
// この時点ではlogging等は出来ない(Loggerオブジェクトが生成されていない)
$fp =
fopen("php://stderr", "r");
fputs($fp, sprintf("error occured while reading config file(s) [%s]\n"), $r->getInfo(0));
* @param string $key 設定項目名
function get($key =
null)
if (isset
($this->config[$key]) ==
false) {
* @param string $key 設定項目名
* @param string $value 設定値
function set($key, $value)
* @return mixed 0:正常終了 Ethna_Error:エラー
return $this->_setConfig();
* @return mixed 0:正常終了 Ethna_Error:エラー
$file =
$this->_getConfigFile();
if (isset
($_SERVER['HTTP_HOST']) && isset
($config['url']) ==
false) {
$config['url'] =
sprintf("http://%s/", $_SERVER['HTTP_HOST']);
if (isset
($config['dsn']) ==
false) {
if (isset
($config['log_facility']) ==
false) {
$config['log_facility'] =
"";
if (isset
($config['log_level']) ==
false) {
$config['log_level'] =
"";
if (isset
($config['log_option']) ==
false) {
$config['log_option'] =
"";
* @return mixed 0:正常終了 Ethna_Error:エラー
$file =
$this->_getConfigFile();
fwrite($lh, "\$config = array(\n");
foreach ($this->config as $key =>
$value) {
$this->_setConfigValue($lh, $key, $value, 0);
function _setConfigValue($fp, $key, $value, $level)
foreach ($value as $k =>
$v) {
$this->_setConfigValue($fp, $k, $v, $level+
1);
* @return string 設定ファイルへのフルパス名
function _getConfigFile()
Documentation generated on Fri, 11 Nov 2011 03:57:46 +0900 by phpDocumentor 1.4.3