From fd0051dab7258c817ff01877bd4324530ce79398 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sun, 17 Feb 2013 23:19:35 +0100 Subject: #2006 - Add system::mark_file_for_delete API to delete files at shutdown. - added system::mark_file_for_delete to be called to mark a file - added system::delete_marked_files to be called at shutdown to delete the list - amended system::temp_filename to, by default, add the temp name to the list - updated a few other places in code where this should be used --- modules/gallery/controllers/uploader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/gallery/controllers/uploader.php') diff --git a/modules/gallery/controllers/uploader.php b/modules/gallery/controllers/uploader.php index 78437071..8e09dbed 100644 --- a/modules/gallery/controllers/uploader.php +++ b/modules/gallery/controllers/uploader.php @@ -55,7 +55,7 @@ class Uploader_Controller extends Controller { if ($form->validate() && $file_validation->validate()) { $temp_filename = upload::save("Filedata"); - Event::add("system.shutdown", create_function("", "unlink(\"$temp_filename\");")); + system::delete_later($temp_filename); try { $item = ORM::factory("item"); $item->name = substr(basename($temp_filename), 10); // Skip unique identifier Kohana adds -- cgit v1.2.3