#include "php_ticks.h"
#include "php_logos.h"
#include "php_streams.h"
+#include "php_open_temporary_file.h"
#include "SAPI.h"
#include "rfc1867.h"
ts_free_id(core_globals_id);
#endif
+ php_shutdown_temporary_directory();
+
module_initialized = 0;
}
/* }}} */
}
/* }}} */
+/* Cache the chosen temporary directory. */
+static char* temporary_directory;
+
+PHPAPI void php_shutdown_temporary_directory()
+{
+ if (temporary_directory) {
+ free(temporary_directory);
+ temporary_directory = NULL;
+ }
+}
+
/*
* Determine where to place temporary files.
*/
PHPAPI const char* php_get_temporary_directory(void)
{
- /* Cache the chosen temporary directory. */
- static char* temporary_directory;
-
/* Did we determine the temporary directory already? */
if (temporary_directory) {
return temporary_directory;
PHPAPI FILE *php_open_temporary_file(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);
PHPAPI const char *php_get_temporary_directory(void);
+PHPAPI void php_shutdown_temporary_directory();
END_EXTERN_C()
#endif /* PHP_OPEN_TEMPORARY_FILE_H */