Removed use of sys_get_temp_dir() as this is not supported by the min PHP version