라이브러리
[PHP] Yaf_Config_Ini::current - 현재 값 검색
Yaf_Config_Ini::current
Yaf_Config_Ini::current는 Yaf_Config_Ini 클래스의 메소드로, 현재 활성화된 설정을 반환합니다. 이 메소드는 Yaf_Config_Ini 객체의 current 속성을 반환합니다.
사용법
Yaf_Config_Ini::current를 사용하려면 Yaf_Config_Ini 객체를 생성하고, current 속성을 설정해야 합니다. 예제를 통해 사용법을 설명하겠습니다.
#hostingforum.kr
php
// config.ini
[database]
host = localhost
port = 3306
username = root
password = password
#hostingforum.kr
php
// config.php
$config = new Yaf_Config_Ini('config.ini');
$config->current = 'database';
// config.php (continued)
echo $config->current->host . "
"; // localhost
echo $config->current->port . "
"; // 3306
echo $config->current->username . "
"; // root
echo $config->current->password . "
"; // password
예제
다음 예제는 Yaf_Config_Ini::current를 사용하여 현재 활성화된 설정을 반환하는 방법을 보여줍니다.
#hostingforum.kr
php
// config.ini
[database]
host = localhost
port = 3306
username = root
password = password
[database2]
host = 192.168.1.100
port = 3307
username = user
password = pass
#hostingforum.kr
php
// config.php
$config = new Yaf_Config_Ini('config.ini');
$config->current = 'database';
echo $config->current->host . "
"; // localhost
echo $config->current->port . "
"; // 3306
echo $config->current->username . "
"; // root
echo $config->current->password . "
"; // password
$config->current = 'database2';
echo $config->current->host . "
"; // 192.168.1.100
echo $config->current->port . "
"; // 3307
echo $config->current->username . "
"; // user
echo $config->current->password . "
"; // pass
결론
Yaf_Config_Ini::current는 Yaf_Config_Ini 클래스의 메소드로, 현재 활성화된 설정을 반환합니다. 이 메소드는 Yaf_Config_Ini 객체의 current 속성을 반환합니다. 예제를 통해 사용법을 설명하였으며, Yaf_Config_Ini::current를 사용하여 현재 활성화된 설정을 반환하는 방법을 보여주었습니다.
-
- 나우호스팅 @pcs8404
-
호스팅포럼 화이팅!
댓글목록
등록된 댓글이 없습니다.