Try to move config out of singleton implementations
[gitphp.git] / include / git / GitExe.class.php
blob:a/include/git/GitExe.class.php -> blob:b/include/git/GitExe.class.php
--- a/include/git/GitExe.class.php
+++ b/include/git/GitExe.class.php
@@ -84,7 +84,7 @@
 	public static function GetInstance()
 	{
 		if (!self::$instance) {
-			self::$instance = new GitPHP_GitExe();
+			self::$instance = new GitPHP_GitExe(GitPHP_Config::GetInstance()->GetValue('gitbin'));
 		}
 		return self::$instance;
 	}
@@ -111,9 +111,8 @@
 	 * @param string $binary path to git binary
 	 * @return mixed git executable class
 	 */
-	protected function __construct()
-	{
-		$binary = GitPHP_Config::GetInstance()->GetValue('gitbin');
+	protected function __construct($binary)
+	{
 		if (empty($binary)) {
 			$binary = GitPHP_GitExe::DefaultBinary();
 		}

comments