最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
当PHP被禁用的PHP函数:tempnam()后
时间:2022-07-02 10:04:50 编辑:袖梨 来源:一聚教程网
当PHP被禁用的PHP函数:tempnam() 后,tempnam()可建立一个临时档,档名不会与同目录中的档案重覆。
传回字串就是建立的临时档名。若发生错误则传回空字串。
而smarty运行就必须在类似templates_c的设置编译目录,然后运行后它会自动创建类似%%
43^43B^43B32F4B%%index.htm.php的临时档,所以,tempnam()被禁用后,当然不能自动创建类似%%
43^43B^43B32F4B%%index.htm.php的临时档,自然自动创建类似%%
43^43B^43B32F4B%%index.htm.php的临时档,是一片空白.
smarty中使用tempnam函数的程序是internals/core.write_file.php,如下代码:
PHP代码:-----------------------------------------------------------------------
// write to tmp file, then rename it to avoid
// file locking race condition
$_tmp_file = tempnam($_dirname, 'wrt');
if (!($fd = @fopen($_tmp_file, 'wb'))) {
$_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt');
if (!($fd = @fopen($_tmp_file, 'wb'))) {
$smarty->trigger_error("problem writing temporary file '$_tmp_file'");
return false;
}
}
fwrite($fd, $params['contents']);
fclose($fd);
相关文章
- boss智能门锁如何设置密码 04-29
- 王者荣耀世界橘右京厉害吗 04-29
- 《青云劫攻略天赋技能,成就无敌仙侠》(解锁潜能,掌握绝学,成就仙侠传奇) 04-29
- 桃源深处有人家藏经室悟证一至七日通关答案 04-29
- 怎么击败《Saros》中的“破碎崛起”先知 Boss 04-29
- 宫小攻略技能推荐2023(玩转宫小,轻松游戏攻略指南) 04-29