Home > Backend Development > PHP Tutorial > 这个方法的功能是啥

这个方法的功能是啥

WBOY
Release: 2016-06-20 12:55:38
Original
1000 people have browsed it

public static function init() {	    // config info	    global $setting_config;	    self::parse_conf($setting_config);	    define('MD5_KEY',md5($setting_config['md5_key']));	    if(function_exists('date_default_timezone_set')){	        if (is_numeric($setting_config['time_zone'])){	            @date_default_timezone_set('Asia/Shanghai');	        }else{	            @date_default_timezone_set($setting_config['time_zone']);	        }	    }	    //session start	    self::start_session();	    	    //output to the template	    Tpl::output('setting_config',$setting_config);	    	    //read language	    Language::read('core_lang_index');	}
Copy after login


回复讨论(解决方案)

init 中文释义:初始化
顾名思义,它是用来完成项目默认参数设置的

初始化框架设置。
执行了几步设置
1.定义MD5_KEY的值
2.设置default timezone
3.开启session
4.把setting_config的值加入到output可使用
5.加载core_lang_index

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template