Re: Suggestion: Add optional suffix to tempnam()

From: Date: Sun, 12 Jan 2014 20:40:32 +0000
Subject: Re: Suggestion: Add optional suffix to tempnam()
References: 1  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Sat, 2014-01-11 at 20:15 +0100, Stefan Neufeind wrote:
> -static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p
> TSRMLS_DC)
> +static int php_do_open_temporary_file(const char *path, const char *pfx, char **opened_path_p
> TSRMLS_DC, const char *suffix)

TSRM should be the last parameter, move your new one in front of it.

> -PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p,
> zend_bool open_basedir_check TSRMLS_DC)
> +PHPAPI int php_open_temporary_fd_ex(const char *dir, const char *pfx, char **opened_path_p,
> zend_bool open_basedir_check TSRMLS_DC, const char *suffix)
 
> -PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p
> TSRMLS_DC)
> +PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p
> TSRMLS_DC, const char *suffix)

> -PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p
> TSRMLS_DC)
> +PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p
> TSRMLS_DC, const char *suffix)
[...]

These are API changes so it could only be in 5.6.0. Eventually it might
be added if instead of changing APIs new functions might be introduced
and the old ones call the new ones.
(also TSRM should be last last there, too)

Aside for that: A test would be good.

For not loosing it either create a feature request at bugs.php.net or
pull request at github.

johannes




Thread (11 messages)

« previous php.internals (#71100) next »