X-Git-Url: http://git.pk910.de/?p=phpgitweb.git;a=blobdiff_plain;f=htdocs%2Flib%2FCommitLoader.class.php;fp=htdocs%2Flib%2FCommitLoader.class.php;h=d6e822c2fa3b0058958b782540bcb9ca4f2f3133;hp=0000000000000000000000000000000000000000;hb=394a07ff3e283f94c7ead44e8bd02d44c223314b;hpb=ce9f1b8b05ff571f6922460cf91b45aa5a119d94 diff --git a/htdocs/lib/CommitLoader.class.php b/htdocs/lib/CommitLoader.class.php new file mode 100644 index 0000000..d6e822c --- /dev/null +++ b/htdocs/lib/CommitLoader.class.php @@ -0,0 +1,36 @@ +. + */ + +class CommitLoader { + private $project; + + public function __construct($project) { + $this->project = $project; + } + + public function load($id) { + if(!Validation::validate_hash($id)) { + trigger_error("Invalid hash parameter", E_USER_ERROR); + return false; + } + $commit = GitCommand::get_commit($this->project['path'], $id); + return $commit; + } + + +}