diff options
author | Chad Parry <github@chad.parry.org> | 2011-04-30 16:40:55 -0600 |
---|---|---|
committer | Chad Parry <github@chad.parry.org> | 2011-04-30 16:40:55 -0600 |
commit | 2375a02e2cdbd1ccaf7dc4d3db9d85119972e3a9 (patch) | |
tree | 8d6282cacc02af244fa1a6d371ff748f227c4a2b /modules/gallery/helpers | |
parent | a8ca9dcf9edd54633c0c78b3af76aa974d38fc64 (diff) |
Change the signature of system::tempnam to something more appropriate for Gallery.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/system.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/gallery/helpers/system.php b/modules/gallery/helpers/system.php index 31ecafa7..9815d588 100644 --- a/modules/gallery/helpers/system.php +++ b/modules/gallery/helpers/system.php @@ -43,15 +43,18 @@ class system_Core { /** * Create a file with a unique file name. - * This helper is similar to the built-in tempnam, except that it supports an optional postfix. + * This helper is similar to the built-in tempnam. + * It allows the caller to specify a prefix and an extension. + * It always places the file in TMPPATH. */ - static function tempnam($dir = TMPPATH, $prefix = "", $postfix = "") { - return self::_tempnam($dir, $prefix, $postfix, "tempnam"); + static function temp_filename($prefix = "", $extension = "") { + return self::_tempnam(TMPPATH, $prefix, ".$extension", "tempnam"); } - // This helper provides a dependency-injected implementation of tempnam. + /** + * This helper provides a dependency-injected implementation of tempnam. + */ static function _tempnam($dir, $prefix, $postfix, $builtin) { - $success = false; do { $basename = call_user_func($builtin, $dir, $prefix); if (!$basename) { |