当PHP被禁用的PHP函数:tempnam() 后
Jun 21, 2016 am 08:59 AM
file
nbsp
php
tempnam
tmp
当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的临时档,所以,tempnam()被禁用后,当然不能自动创建类似%%
43^43B^43B32F4B%%index.htm.php的临时档,自然自动创建类似%%
43^43B^43B32F4B%%index.htm.php的临时档,是一片空白.
smarty中使用tempnam函数的程序是internals/core.write_file.php,如下代码:
smarty中使用tempnam函数的程序是internals/core.write_file.php,如下代码:
<font size="2"><font face="Verdana">PHP代码:</font><hr></font><code><font color="#000000"><font color="#0000bb"><br></font><font color="#ff8000">// write to tmp file, then rename it to avoid<br> // file locking race condition<br> </font><font color="#0000bb">$_tmp_file </font><font color="#007700">= </font><font color="#0000bb">tempnam</font><font color="#007700">(</font><font color="#0000bb">$_dirname</font><font color="#007700">, </font><font color="#dd0000">'wrt'</font><font color="#007700">);<br> if (!(</font><font color="#0000bb">$fd </font><font color="#007700">= @</font><font color="#0000bb">fopen</font><font color="#007700">(</font><font color="#0000bb">$_tmp_file</font><font color="#007700">, </font><font color="#dd0000">'wb'</font><font color="#007700">))) {<br> </font><font color="#0000bb">$_tmp_file </font><font color="#007700">= </font><font color="#0000bb">$_dirname </font><font color="#007700">. </font><font color="#0000bb">DIRECTORY_SEPARATOR </font><font color="#007700">. </font><font color="#0000bb">uniqid</font><font color="#007700">(</font><font color="#dd0000">'wrt'</font><font color="#007700">);<br> if (!(</font><font color="#0000bb">$fd </font><font color="#007700">= @</font><font color="#0000bb">fopen</font><font color="#007700">(</font><font color="#0000bb">$_tmp_file</font><font color="#007700">, </font><font color="#dd0000">'wb'</font><font color="#007700">))) {<br> </font><font color="#0000bb">$smarty</font><font color="#007700">-></font><font color="#0000bb">trigger_error</font><font color="#007700">(</font><font color="#dd0000">"problem writing temporary file '$_tmp_file'"</font><font color="#007700">);<br> return </font><font color="#0000bb">false</font><font color="#007700">;<br> }<br> }<br> </font><font color="#0000bb">fwrite</font><font color="#007700">(</font><font color="#0000bb">$fd</font><font color="#007700">, </font><font color="#0000bb">$params</font><font color="#007700">[</font><font color="#dd0000">'contents'</font><font color="#007700">]);<br> </font><font color="#0000bb">fclose</font><font color="#007700">(</font><font color="#0000bb">$fd</font><font color="#007700">);<br></font><font color="#0000bb"></font></font></code><hr>Copy after login
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

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
