Browse Source

Don't load the AutoLog class if we're not in debug mode

Chris Han 10 years ago
parent
commit
45c9e86013

+ 2 - 1
include/git/GitObjectLoader.class.php

@@ -66,7 +66,8 @@ class GitPHP_GitObjectLoader
 			return false;
 		}
 
-		$autolog = new GitPHP_DebugAutoLog();
+		if (GitPHP_DebugLog::GetInstance()->GetEnabled())
+			$autolog = new GitPHP_DebugAutoLog();
 
 		// first check if it's unpacked
 		$path = $this->project->GetPath() . '/objects/' . substr($hash, 0, 2) . '/' . substr($hash, 2);

+ 2 - 1
include/git/headlist/HeadListLoad_Raw.class.php

@@ -36,7 +36,8 @@ class GitPHP_HeadListLoad_Raw extends GitPHP_RefListLoad_Raw implements GitPHP_H
 		if (empty($order))
 			return;
 
-		$autotimer = new GitPHP_DebugAutoLog();
+		if (GitPHP_DebugLog::GetInstance()->GetEnabled())
+			$autotimer = new GitPHP_DebugAutoLog();
 
 		$heads = $headList->GetHeads();
 

+ 2 - 1
include/git/reflist/RefListLoad_Raw.class.php

@@ -24,7 +24,8 @@ abstract class GitPHP_RefListLoad_Raw
 		if (empty($type))
 			return;
 
-		$autotimer = new GitPHP_DebugAutoLog();
+		if (GitPHP_DebugLog::GetInstance()->GetEnabled())
+			$autotimer = new GitPHP_DebugAutoLog();
 
 		$refs = array();