Lines Matching +full:- +full:- +full:date
32 $this->id = $id;
33 $this->changelog = new PageChangeLog($this->id);
39 return $this->id;
45 return wikiFN($this->id, $rev);
49 * Get raw WikiText of the page, considering change type at revision date
58 $revInfo = $rev ? $this->changelog->getRevisionInfo($rev) : false;
61 : io_readWikiPage($this->getPath($rev), $this->id, $rev); // retrieve from attic
63 return io_readWikiPage($this->getPath(), $this->id, '');
94 if (isset($this->data)) return;
96 $pagefile = $this->getPath();
98 $currentContent = $this->rawWikiText();
103 'id' => $this->id,// should not be altered by any handlers
114 'sizechange' => strlen($text) - strlen($currentContent),
129 $is_minor_change = ($minor && $conf['useacl'] && $INPUT->server->str('REMOTE_USER'));
135 $this->data = $data;
139 if (!$event->advise_before()) return;
144 // Check whether the pagefile has modified during $event->advise_before()
150 $this->detectExternalEdit();
169 $ioData = [[$pagefile, '', false], getNS($this->id), noNS($this->id), false];
171 // pre-save deleted revision
174 $data['newRevision'] = $this->saveOldRevision();
180 // purge non-persistant meta data
181 p_purge_metadata($this->id);
183 io_sweepNS($this->id, 'datadir');
184 io_sweepNS($this->id, 'mediadir');
187 io_writeWikiPage($pagefile, $data['newContent'], $this->id);
188 // pre-save the revision, to keep the attic in sync
189 $data['newRevision'] = $this->saveOldRevision();
192 $data['sizechange'] = $filesize_new - $filesize_old;
194 $event->advise_after();
199 $logEntry = $this->changelog->addLogEntry([
200 'date' => $data['newRevision'],
203 'id' => $this->id,
204 'user' => $INPUT->server->str('REMOTE_USER'),
210 $this->updateMetadata($logEntry);
228 $revInfo = $this->changelog->getCurrentRevisionInfo();
236 $fileLastMod = $this->getPath();
238 if (touch($fileLastMod, $revInfo['date'])) {
240 $msg = "PageFile($this->id)::detectExternalEdit(): timestamp successfully modified";
241 $details = '(' . $wrong_timestamp . ' -> ' . $revInfo['date'] . ')';
245 … $msg = "PageFile($this->id)::detectExternalEdit(): page file should be newer than last revision "
246 … . '(' . filemtime($fileLastMod) . ' < ' . $this->changelog->lastRevision() . ')';
252 if ($revInfo['date'] == time()) sleep(1); // wait a tick
255 $this->saveOldRevision();
257 $this->changelog->addLogEntry($revInfo);
259 $cache = new CacheInstructions($this->id, $this->getPath());
260 $cache->removeCache();
264 * Moves the current version to the attic and returns its revision date
272 $oldfile = $this->getPath();
274 $date = filemtime($oldfile);
275 $newfile = $this->getPath($date);
276 io_writeWikiPage($newfile, $this->rawWikiText(), $this->id, $date);
277 return $date;
289 ['date' => $date, 'type' => $changeType, 'user' => $user, ] = $logEntry;
296 $createdDate = @filectime($this->getPath());
300 $oldmeta = p_read_metadata($this->id)['persistent'];
305 (empty($oldmeta['date']['created']) || $oldmeta['date']['created'] === $createdDate)
308 $meta['date']['created'] = $createdDate;
313 } elseif (($wasCreated || $wasReverted) && !empty($oldmeta['date']['created'])) {
314 // re-created / restored
315 $meta['date']['created'] = $oldmeta['date']['created'];
316 $meta['date']['modified'] = $createdDate; // use the files ctime here
321 } elseif (!$wasMinorEdit) { // non-minor modification
322 $meta['date']['modified'] = $date;
328 p_set_metadata($this->id, $meta);