Extract the changesets of a dokuwikipage and put it into DokuWikiPage::ChangeLog.
This commit is contained in:
parent
e9576d0d58
commit
29ebda487a
1 changed files with 13 additions and 0 deletions
|
@ -11,6 +11,8 @@ namespace enko\dokuwiki\objectrepresentation;
|
|||
|
||||
class DokuWikiPage extends DokuWikiNode
|
||||
{
|
||||
public $ChangeLog;
|
||||
|
||||
/**
|
||||
* @param $filename
|
||||
* @param null $parent
|
||||
|
@ -26,6 +28,17 @@ class DokuWikiPage extends DokuWikiNode
|
|||
foreach ($metadata as $key => $value) {
|
||||
$this->setMetaData($key, $value);
|
||||
}
|
||||
// extract changelog
|
||||
$this->ChangeLog = new \ArrayObject();
|
||||
$file = metaFN($this->getFullID(), '.changes');
|
||||
if (file_exists($file)) {
|
||||
$changelog_entries = explode("\n", file_get_contents($file));
|
||||
foreach ($changelog_entries as $raw_entry) {
|
||||
$entry = parseChangelogLine($raw_entry);
|
||||
$changelog = new DokuWikiChangeset($entry['date'], $entry['extra'], $entry['id'], $entry['ip'], $entry['sum'], $entry['type'], $entry['user']);
|
||||
$this->ChangeLog->append($changelog);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in a new issue