fixed variable error
[GITManagedWebpage.git] / GITManagedWebpage.class.php
index 6b6d903b57f095fdda048aa9b4fc9e6e52ce3e7b..fee826c0e284d0d24d0bdabac4961f04140e3d49 100644 (file)
@@ -313,7 +313,7 @@ class GITManagedWebpage {
         }
     }
     
-    public function execute($file = null) {
+    public function getExecFile($file = null) {
         if($this->loopedcall)
             return;
         define("GITMANAGED_EXECUTED", true);
@@ -326,16 +326,15 @@ class GITManagedWebpage {
         $default_branch = $this->getConfig("defaultbranch");
         $active_branch = $this->getActiveBranch();
         if($active_branch != $default_branch) {
-            if(!($dir = $this->localBranchPath($branch))) {
+            if(!($dir = $this->localBranchPath($active_branch))) {
                 $dir = $this->localBranchPath($active_branch, true);
                 $this->updateBranch($active_branch, $dir, true);
             }
             chdir($dir);
-            include_once($dir.$file);
+            return $dir.$file;
         } else {
-            include($file); //possible loop!
+            return $file;
         }
-        die();
     }
     
 }