2 require_once 'MTrack/Interface/CommitListener.php';
3 //require_once 'MTrack/Changeset.php';
5 class MTrackCommitCheck_Wiki implements IMTrackCommitListener
7 function vetoCommit($msg, $files, $actions, $checker) {
11 function postCommit($msg, $files, $actions) {
12 /* is this affecting the wiki? */
14 $suf = MTrackConfig::get('core', 'wikifilenamesuffix');
15 foreach ($files as $name) {
16 list($repo, $fname) = explode('/', $name, 2);
17 if ($repo == 'wiki') {
18 if ($suf && substr($fname, -strlen($suf)) == $suf) {
19 $fname = substr($fname, 0, -strlen($suf));
24 /* MTRACK_WIKI_COMMIT is set by MTrackWikiItem when it commits,
25 * so we check for the absence of it to determine if mtrack has
26 * recorded a changeset record */
27 if (count($wiki) && getenv("MTRACK_WIKI_COMMIT") != "1") {
28 /* wiki being changed outside of the MTrackWikiItem class, so
29 * let's create a changeset record for the search engine to
30 * pick up and index this change */
31 foreach ($wiki as $name) {
32 $CS = MTrackChangeset::begin("wiki:$name", $msg);