Home | Mirror | SearchITEYE 博客 | OSChina 博客 | 51CTO 博客

9.3. PHP_INI

讀取INI檔案

		
INI_STR(name)
INI_INT(name)
		
		
		
/* {{{ PHP_INI
 */

PHP_INI_BEGIN()
    PHP_INI_ENTRY("safenet.url", "http://localhost/", PHP_INI_ALL, NULL)
    PHP_INI_ENTRY("safenet.key", "key01", PHP_INI_ALL, NULL)
PHP_INI_END()

/* }}} */

/* {{{ PHP_MINIT_FUNCTION
 */
PHP_MINIT_FUNCTION(safenet)
{

	REGISTER_INI_ENTRIES();

	return SUCCESS;
}
/* }}} */

/* {{{ PHP_MSHUTDOWN_FUNCTION
 */
PHP_MSHUTDOWN_FUNCTION(safenet)
{

	UNREGISTER_INI_ENTRIES();

	return SUCCESS;
}
/* }}} */

/* {{{ PHP_MINFO_FUNCTION
 */
PHP_MINFO_FUNCTION(safenet)
{
	php_info_print_table_start();
	php_info_print_table_header(2, "safenet support", "enabled");
	php_info_print_table_row(2, "author", "Neo Chan<netkiller@msn.com>");
	php_info_print_table_row(2, "safenet.url", INI_STR("safenet.url"));
	php_info_print_table_row(2, "safenet.key", INI_STR("safenet.key"));
	php_info_print_table_end();

	/* Remove comments if you have entries in php.ini
	DISPLAY_INI_ENTRIES();
	*/
}
/* }}} */
		
		
comments powered by Disqus