previousConfig::isConfigTypeRegistered (Previous) (Next) Config::registerConfigTypenext

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Config::parseConfig

Config::parseConfig() – データソースの内容を解析する

Synopsis

require_once 'Config.php';

mixed &Config::parseConfig ( mixed $datasrc , string $configType , array $options = array() )

Description

このメソッドは、与えられたデータソースを解析し、 ルートConfig_Container オブジェクトを他のConfig_Container オブジェクトで補充します。 もし何らかの理由で行かなければ、ルートConfig_Container オブジェクトへのリファレンスか、 あるいはPEAR_Errorを返すでしょう。

Parameter

mixed $datasrc

解析するべきデータソースです。 ほとんどのコンテナーについては、それはファイルパスです。 PHP配列パーサーについては、配列を指定します。

string $configType

解析するべき設定のタイプです。

array $options

パーサー用オプションです。

Return value

object - Config_Containerオブジェクトのリファレンスです。

Throws

Possible PEAR_Error values
エラーコード エラー値 意味 解決策
PEAR_ERROR_RETURN "Configuration type '$configType' is not registered in Config::parseConfig." その型を使用する前に Config に登録しなければなりません。 標準の型のうちのいずれかを使用するか、あるいは自作のコンテナを Config::registerConfigType で登録します。

使用しているコンテナによっては、これ以外のエラーが返される可能性もあります。

Note

This function can not be called statically.

Example

parseConfig()の使用法

<?php
$config 
= new Config();
$root =& $config->parseConfig('/path/to/file.php''phparray'
                                array(
'name' => 'conf'));
?>
previousConfig::isConfigTypeRegistered (Previous) (Next) Config::registerConfigTypenext

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
Note by: info@karikas.com
Ahoy, a quick reference - values for the config type can be (as per v 1.21): apache, genericconf, inifile, inicommented, phparray, xml.