/** * Returns a temporary directory - one that is automatically deleted at the end * of the script. * * @param string $ext * @return Temp */ public static function temp_dir() { $ext = $ext ? '.' . $ext : ''; Temp::set_temp_root(api_get_path(SYS_ARCHIVE_PATH) . 'temp'); $path = Temp::get_temporary_name() . $ext; return Temp::dir($path); }