Use relative path for Git.php and $conf['tempdir'] for temp file.
authorDanny Lin <danny0838@gmail.com>
Sat, 19 Oct 2013 04:36:54 +0000 (12:36 +0800)
committerDanny Lin <danny0838@gmail.com>
Sun, 20 Oct 2013 15:43:51 +0000 (23:43 +0800)
action/editcommit.php

index 1f3de50..e158192 100644 (file)
@@ -14,10 +14,16 @@ if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
 if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
 
 require_once DOKU_PLUGIN.'action.php';
-require_once(DOKU_PLUGIN.'gitbacked/lib/Git.php');
+require_once dirname(__FILE__).'/../lib/Git.php';
 
 class action_plugin_gitbacked_editcommit extends DokuWiki_Action_Plugin {
 
+    function __construct() {
+        global $conf;
+        $this->temp_dir = $conf['tmpdir'].'/gitbacked';
+        io_mkdir_p($this->temp_dir);
+    }
+
     public function register(Doku_Event_Handler &$controller) {
 
         $controller->register_hook('IO_WIKIPAGE_WRITE', 'AFTER', $this, 'handle_io_wikipage_write');
@@ -28,7 +34,7 @@ class action_plugin_gitbacked_editcommit extends DokuWiki_Action_Plugin {
 
     public function handle_periodic_pull(Doku_Event &$event, $param) {
         if ($this->getConf('periodicPull')) {
-            $lastPullFile = DOKU_PLUGIN.'gitbacked/action/lastpull.txt';
+            $lastPullFile = $this->temp_dir.'/lastpull.txt';
             //check if the lastPullFile exists
             if (is_file($lastPullFile)) {
                 $lastPull = unserialize(file_get_contents($lastPullFile));