53 $this->wiki = $a_wiki;
54 $this->
user = $a_user;
67 $set = $this->db->query(
"SELECT * FROM wiki_user_html_export ".
68 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer")
70 if (!$this->
data = $this->db->fetchAssoc($set))
84 $this->log->debug(
"getProcess");
87 $ilAtomQuery = $this->db->buildAtomQuery();
88 $ilAtomQuery->addTableLock(
'wiki_user_html_export');
92 $this->log->debug(
"atom query start");
97 if ($this->
data[
"start_ts"] !=
"" &&
98 $this->
data[
"start_ts"] > $last_change)
100 $ret = self::PROCESS_UPTODATE;
101 $this->log->debug(
"return: ".self::PROCESS_UPTODATE);
105 if (!isset($this->
data[
"wiki_id"]))
107 $this->log->debug(
"insert, wiki id: ".$this->wiki->getId().
", user id: ".$this->
user->getId().
", ts: ".$ts);
108 $ilDB->
manipulate(
"INSERT INTO wiki_user_html_export ".
109 "(wiki_id, usr_id, progress, start_ts, status) VALUES (".
110 $ilDB->
quote($this->wiki->getId(),
"integer").
",".
111 $ilDB->
quote($this->user->getId(),
"integer").
",".
112 $ilDB->
quote(0,
"integer").
",".
113 $ilDB->
quote($ts,
"timestamp").
",".
114 $ilDB->
quote(self::RUNNING,
"integer").
119 $this->log->debug(
"update, wiki id: ".$this->wiki->getId().
", user id: ".$this->
user->getId().
", ts: ".$ts);
120 $ilDB->
manipulate(
"UPDATE wiki_user_html_export SET ".
121 " start_ts = ".$ilDB->
quote($ts,
"timestamp").
",".
122 " usr_id = ".$ilDB->quote($this->
user->getId(),
"integer").
",".
123 " progress = ".$ilDB->
quote(0,
"integer").
",".
124 " status = ".$ilDB->quote(self::RUNNING,
"integer").
125 " WHERE status = ".$ilDB->quote(self::NOT_RUNNING,
"integer").
126 " AND wiki_id = ".$ilDB->quote($this->wiki->getId(),
"integer")
131 if ($this->
data[
"start_ts"] == $ts && $this->
data[
"usr_id"] == $this->
user->getId())
134 $ret = self::PROCESS_STARTED;
135 $this->log->debug(
"return: ".self::PROCESS_STARTED);
140 $ret = self::PROCESS_OTHER_USER;
141 $this->log->debug(
"return: ".self::PROCESS_OTHER_USER);
146 $this->log->debug(
"outer return: ".
$ret);
159 $this->db->manipulate(
"UPDATE wiki_user_html_export SET ".
160 " progress = ".$this->db->quote((
int) $a_progress,
"integer").
",".
161 " status = ".$this->db->quote((
int) $a_status,
"integer").
162 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer").
163 " AND usr_id = ".$this->db->quote($this->user->getId(),
"integer")
177 $set = $this->db->query(
"SELECT progress, status FROM wiki_user_html_export ".
178 " WHERE wiki_id = ".$this->db->quote($this->wiki->getId(),
"integer")
180 $rec = $this->db->fetchAssoc($set);
182 return array(
"progress" => (
int) $rec[
"progress"],
"status" => (
int) $rec[
"status"]);
204 ignore_user_abort(
true);
206 include_once(
"./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
209 $exp->buildExportFile();
220 $this->log->debug(
"deliver");
221 include_once(
"./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
224 $file = $exp->getUserExportFile();
225 $this->log->debug(
"file: ".
$file);
updateStatus($a_progress, $a_status)
Update status.
__construct(ilObjWiki $a_wiki, ilDBInterface $a_db, ilObjUser $a_user)
Construct.
deliverFile()
Deliver file.
initUserHTMLExport()
Init user html export.
static getLastChangeByParent($a_parent_type, $a_parent_id, $a_lang="")
Get all pages for parent object.
static now()
Return current timestamp in Y-m-d H:i:s format.
Class manages user html export.
static deliverFile($a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
Create styles array
The data for the language used.
getProgress()
Get Progress.
startUserHTMLExport()
Start user html export.
Wiki HTML exporter class.
static getLogger($a_component_id)
Get component logger.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file