From e3449aa1aa388cfa45d92210c06b74fc7b7397e7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 23 Aug 2012 13:03:39 +0400 Subject: add experimental self-updating script --- include/functions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 957146f1f..69b481ac4 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5506,4 +5506,18 @@ return null; } + + function tmpdirname($path, $prefix) { + // Use PHP's tmpfile function to create a temporary + // directory name. Delete the file and keep the name. + $tempname = tempnam($path,$prefix); + if (!$tempname) + return false; + + if (!unlink($tempname)) + return false; + + return $tempname; + } + ?> -- cgit v1.2.3