\n"); $org_part = "getVersion()."\">\n"; fwrite($file, $org_part); // Use ttGroupExportHelper to export all groups. $groupExportHelper = new ttGroupExportHelper($user->group_id, $file, ' '); // 2 spaces indentation for home group. $groupExportHelper->writeData(); fwrite($file, "\n"); fclose($file); if ($compress) { $this->fileName = tempnam($dirName, 'tt'); $this->compress($tmp_file, $this->fileName); unlink($tmp_file); } else $this->fileName = $tmp_file; return true; } // getFileName - returns file name. function getFileName() { return $this->fileName; } // compress - compresses the content of the $in file into $out file. function compress($in, $out) { // Initial checks of file names and permissions. if (!file_exists($in) || !is_readable ($in)) return false; if ((!file_exists($out) && !is_writable(dirname($out))) || (file_exists($out) && !is_writable($out))) return false; $in_file = fopen($in, 'rb'); if (function_exists('bzopen')) { if (!$out_file = bzopen($out, 'w')) return false; while (!feof ($in_file)) { $buffer = fread($in_file, 4096); bzwrite($out_file, $buffer, 4096); } bzclose($out_file); } fclose ($in_file); return true; } private function getVersion() { $mdb2 = getConnection(); $sql = "select param_value from tt_site_config where param_name = 'version_db'"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); return $val['param_value']; $result[] = $val; } return false; } }