Show an error message if the git or diff EXEs aren't working, bug #57
[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
@@ -219,6 +219,25 @@
 	}
 
 	/**
+	 * Valid
+	 *
+	 * Tests if this executable is valid
+	 *
+	 * @access public
+	 * @return boolean true if valid
+	 */
+	public function Valid()
+	{
+		if (empty($this->binary))
+			return false;
+
+		$code = 0;
+		$out = exec($this->binary . ' --version', $tmp, $code);
+
+		return $code == 0;
+	}
+
+	/**
 	 * DefaultBinary
 	 *
 	 * Gets the default binary for the platform

comments