当PHP被禁用的PHP函数:tempnam() 后

当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);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值