@ -37,4 +37,16 @@ class RepositoryDir extends RepositoryBase {
return $data;
}
function scandir($path="") {
return scandir("{$this->path}/{$path}");
function file_get_contents ($file) {
return file_get_contents("{$this->path}/{$file}");
function file_put_contents ($file, $content) {
return file_put_contents("{$this->path}/{$file}", $content);
@ -36,4 +36,23 @@ class RepositoryGit extends RepositoryBase {
if ($path !== '' && substr($path, -1) !== '/') {
$path .= '/';
$d = popen("cd " . escapeShellArg($this->path) . "; git ls-tree HEAD " . escapeShellArg($path), "r");
$ret = array();
while ($r = fgets($d)) {
$ret[] = substr($r, 53);
pclose($d);
return $ret;
return shell_exec("cd " . escapeShellArg($this->path) . "; git show HEAD:" . escapeShellArg($file));