* change for ajax save log for svn and git.

This commit is contained in:
wangyidong
2016-12-06 10:39:19 +08:00
parent 2f679cee93
commit e10309b1d0
3 changed files with 18 additions and 6 deletions
+3 -1
View File
@@ -28,7 +28,7 @@ include './framework/control.class.php';
include './framework/model.class.php';
include './framework/helper.class.php';
include './config/config.php';
/* Set the PATH_INFO variable. */
if($config->requestType == 'PATH_INFO')
{
@@ -52,6 +52,8 @@ if($config->requestType == 'PATH_INFO')
$_SERVER['PATH_INFO'] = '/';
}
}
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
}
else
{
+8 -4
View File
@@ -121,17 +121,21 @@ class git extends control
$message = trim($this->post->message);
$revision = trim($this->post->revision);
$files = $this->post->files;
/* Ignore git. */
if(strpos($repoUrl, '://') === false) die();
if(empty($repoUrl)) die();
$parsedFiles = array();
foreach($files as $file)
{
$file = trim($file);
if(empty($file)) continue;
$action = '';
if(preg_match('/^[\w][ \t]/', $file))
{
$action = $file[0];
$file = trim(substr($file, 2));
}
$path = str_replace($repoRoot, '', $file);
$parsedFiles[''][] = $path;
$parsedFiles[$action][] = ltrim($path, '/');
}
$objects = $this->git->parseComment($message);
+7 -1
View File
@@ -118,8 +118,14 @@ class svn extends control
{
$file = trim($file);
if(empty($file)) continue;
$action = '';
if(preg_match('/^[\w][ \t]/', $file))
{
$action = $file[0];
$file = trim(substr($file, 2));
}
$path = str_replace($repoRoot, '', $file);
$parsedFiles[''][] = $path;
$parsedFiles[$action][] = $path;
}
$objects = $this->svn->parseComment($message);