技术点
- error_reporting()。设置php要显示错误报告的错误等级,如果要显示parse_error,需要在php.ini配置文件中修改display_errors = on。
- set_magic_quotes_runtime(boolean)。从这个链接(http://php.net/manual/zh/function.set-magic-quotes-runtime.php)的例子可知,此函数是控制php读取字符串时是否对斜杠\进行解析。参数为false则进行解析。
- set_time_limit()。设置php最大运行时间,以秒为单位。
- getgpc(key)。这个函数在discuz中有多处实现,其功能是获取GET/POST/COOKIE/REQUEST请求中的参数。
- 以下代码可对用户浏览的网址进行重定向,但是在调用下面的代码前不应该对用户输出任何内容,否则重定向将失效: header(“Location: index.php?step=3&install_ucenter=yes”); die; 如果要进行永久重定向,则应写为: header(“Location: index.php?step=3&install_ucenter=yes”, true , 301); die;
- 变量有值则输出变量,php里很巧妙的写法:$comment && print(’’.$comment);
功能
discuz安装功能在install文件夹内,整个安装过程都在install.php中,并且通过判断ROOT/data/install.lock文件是否来判断安装是否已完成。install.lock文件由下面的ext_info步骤创建,如果install.lock文件不