From a74609097fc47e13dd6d552f90e72f2ebd52e93a Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 10 Mar 2010 17:26:20 -0500 Subject: [PATCH] Setting the temp dir for the Spreadsheet_Excel_Writer class problems found in some servers due the tempnam PHP function. tmp file set to api_get_path(SYS_ARCHIVE_PATH) see BT#836 Thanks to Noa for reporting it. --- main/exercice/exercise_result.class.php | 2 ++ main/gradebook/gradebook_result.class.php | 2 ++ main/inc/lib/debug.lib.inc.php | 1 - main/survey/survey.lib.php | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main/exercice/exercise_result.class.php b/main/exercice/exercise_result.class.php index 0b5ec3fd94..dedde3d5c1 100755 --- a/main/exercice/exercise_result.class.php +++ b/main/exercice/exercise_result.class.php @@ -343,6 +343,8 @@ class ExerciseResult } //build the results require_once(api_get_path(LIBRARY_PATH).'pear/Spreadsheet_Excel_Writer/Writer.php'); $workbook = new Spreadsheet_Excel_Writer(); + $workbook ->setTempDir(api_get_path(SYS_ARCHIVE_PATH)); + $workbook->send($filename); $worksheet =& $workbook->addWorksheet('Report '.date('YmdGis')); $line = 0; diff --git a/main/gradebook/gradebook_result.class.php b/main/gradebook/gradebook_result.class.php index 8fee7ea7de..a8fc79ed60 100755 --- a/main/gradebook/gradebook_result.class.php +++ b/main/gradebook/gradebook_result.class.php @@ -255,6 +255,8 @@ class GradeBookResult //build the results require_once(api_get_path(LIBRARY_PATH).'pear/Spreadsheet_Excel_Writer/Writer.php'); $workbook = new Spreadsheet_Excel_Writer(); + $workbook ->setTempDir(api_get_path(SYS_ARCHIVE_PATH)); + $workbook->send($filename); $worksheet =& $workbook->addWorksheet('Report '.date('YmdGis')); $line = 0; diff --git a/main/inc/lib/debug.lib.inc.php b/main/inc/lib/debug.lib.inc.php index f04bf7f909..ee00857bfd 100755 --- a/main/inc/lib/debug.lib.inc.php +++ b/main/inc/lib/debug.lib.inc.php @@ -66,7 +66,6 @@ function debug_paths() echo 'SYS_CODE_PATH :'.api_get_path(SYS_CODE_PATH).'
'; echo 'SYS_LANG_PATH :'.api_get_path(SYS_LANG_PATH).'
'; echo 'WEB_IMG_PATH :'.api_get_path(WEB_IMG_PATH).'
'; - echo 'GARBAGE_PATH :'.api_get_path(GARBAGE_PATH).'
'; echo 'PLUGIN_PATH :'.api_get_path(PLUGIN_PATH).'
'; echo 'SYS_ARCHIVE_PATH :'.api_get_path(SYS_ARCHIVE_PATH).'
'; echo 'INCLUDE_PATH :'.api_get_path(INCLUDE_PATH).'
'; diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index d1db46b367..957f5460a6 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -3528,6 +3528,7 @@ class SurveyUtil { require_once(api_get_path(LIBRARY_PATH).'pear/Spreadsheet_Excel_Writer/Writer.php'); $workbook = new Spreadsheet_Excel_Writer(); + $workbook ->setTempDir(api_get_path(SYS_ARCHIVE_PATH)); $workbook->send($filename); $worksheet =& $workbook->addWorksheet('Report 1'); $line = 0;