Hello DokuWiki,
I develop a dokuwiki action plugin called rsync (remote synchronisation)
It's purpose is to mirror automatically and in real-time an original dokuwiki to a mirror dokuwiki. (RAID 1)
To limit requirements, it is designed to be run inside dokuwiki (only INDEXER_TASKS_RUN cron) and to use only PHP code.
Also it use only file_get_contents function to transfer data between original and mirror dokuwikis.
It use the following events: IO_WIKIPAGE_WRITE, MEDIA_UPLOAD_FINISH, MEDIA_DELETE_FILE for queuing modifications and INDEXER_TASKS_RUN for doing atomic synchronization and handling retries.
On the mirror dokuwiki, the rsync plugin issue XML-RPC calls (wiki.putPage, wiki.putAttachment, wiki.deleteAttachment)
(dokuwiki.login will be used only if required)
So my request. Is it possible to add to IO_WIKIPAGE_WRITE event the following parameters ?
$data[4] //summary
$data[5] //minor
-----------------------------------------------------------------------------------------------------------------------------
inc/common.php: function saveWikiText($id,$text,$summary,$minor=false){
// Send "update" event with empty data, so plugins can react to page deletion
- $data = array(array($file, '', false), getNS($id), noNS($id), false);
+ if(empty($summary)) $summary = $lang['deleted'];
+ $data = array(array($file, '', false), getNS($id), noNS($id), false, $summary, $minor);
trigger_event('IO_WIKIPAGE_WRITE', $data);
...
// save file (namespace dir is created in io_writeWikiPage)
- io_writeWikiPage($file, $text, $id);
+ io_writeWikiPage($file, $text, $id, false, $summary, $minor);
-----------------------------------------------------------------------------------------------------------------------------
inc/io.php: function io_writeWikiPage($file, $content, $id, $rev=false) {
/**
* Used to write out a DokuWiki page to file, and send IO_WIKIPAGE_WRITE events.
*
* This generates an action event and delegates to io_saveFile().
* Action plugins are allowed to modify the page content in transit.
* The file path should not be changed.
* (The append parameter is set to false.)
*
* Event data:
* $data[0] The raw arguments for io_saveFile as an array.
* $data[1] ns: The colon separated namespace path minus the trailing page name. (false if root ns)
* $data[2] page_name: The wiki page name.
* $data[3] rev: The page revision, false for current wiki pages.
+ * $data[4] sum: The page modification summary
+ * $data[5] minor: false for major page change
*
* @author Ben Coburn <
btcoburn@silicodon.net>
*/
-function io_writeWikiPage($file, $content, $id, $rev=false) {
+function io_writeWikiPage($file, $content, $id, $rev=false, $sum=false, $minor=false) {
if (empty($rev)) { $rev = false; }
if ($rev===false) { io_createNamespace($id); } // create namespaces as needed
- $data = array(array($file, $content, false), getNS($id), noNS($id), $rev);
+ $data = array(array($file, $content, false), getNS($id), noNS($id), $rev, $sum, $minor);
Thanks you for Dokuwiki
Philippe