rfc:tempnam-suffix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
rfc:tempnam-suffix [2014/01/25 09:12] – created neufeindrfc:tempnam-suffix [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== PHP RFC: Add suffix-parameter to tempnam ====== ====== PHP RFC: Add suffix-parameter to tempnam ======
-  * Version: 0.9+  * Version: 1.0
   * Date: 2013-02-25   * Date: 2013-02-25
   * Author: Stefan Neufeind, neufeind@php.net   * Author: Stefan Neufeind, neufeind@php.net
Line 9: Line 9:
  
 Current it is possible to optionally specify a prefix to generated filenames. In some cases however it is needed to create files with a certain suffix (like a file-extension) because other tools rely on for example a graphic-name ending with .png. Current it is possible to optionally specify a prefix to generated filenames. In some cases however it is needed to create files with a certain suffix (like a file-extension) because other tools rely on for example a graphic-name ending with .png.
 +
 +There is already a "prefix"-parameter that will be used in front of the automatically generated temporary name. The "suffix" proposed here, if specified, will be added to the end of the resulting temporary name.
  
 ===== Proposal ===== ===== Proposal =====
Line 16: Line 18:
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
  
-Internal API-changes since the additional parameter is added.+The suffix-parameter is optional. Thus it is transparent to any existing PHP-code in use. 
 + 
 +Only internal API if affected because of the additional parameter which is added.
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 33: Line 37:
  
 https://github.com/neufeind/php-src/tree/tempnam-with-suffix https://github.com/neufeind/php-src/tree/tempnam-with-suffix
 +
 +===== Documentation-snippets =====
 +
 +string tempnam ( string $dir , string $prefix [, string $suffix] )
 +
 +suffix  The suffix of the generated temporary filename. 
 +
 +Changelog:
 +5.6.0 The suffix parameter was added
 +
 +
 +Example #2 tempnam() example
 +
 +<code>
 +$tmpfname = tempnam("/tmp", "FOO", ".png");
 +echo $tmpfname; // will be "/tmp/FOO<something>.png"
 +</code>
rfc/tempnam-suffix.1390641139.txt.gz · Last modified: 2017/09/22 13:28 (external edit)