* fix a bug for svn and adjust burn.

This commit is contained in:
wangyidong
2015-08-05 16:09:12 +08:00
parent 4d0ff8f8c8
commit 1625f0394e
3 changed files with 35 additions and 6 deletions

View File

@@ -168,10 +168,7 @@ class devModel extends model
$comment = preg_split('/\r?\n\r?/', $comment);
// Trim asterisks and whitespace from the beginning and whitespace from the end of lines.
$comment = array_map(function($line)
{
return ltrim(rtrim($line), "* \t\n\r\0\x0B");
}, $comment);
$comment = array_map(array('devModel', "trimSpace"), $comment);
// Group the lines together by @tags
$blocks = array();
@@ -246,4 +243,16 @@ class devModel extends model
}
return $modules;
}
/**
* Trim asterisks and whitespace from the beginning and whitespace from the end of lines.
*
* @param string $line
* @access public
* @return string
*/
public function trimSpace($line)
{
return ltrim(rtrim($line), "* \t\n\r\0\x0B");
}
}

View File

@@ -37,10 +37,30 @@ class reportModel extends model
public function createSingleJSON($sets, $dateList)
{
$data = '[';
$now = date('Y-m-d');
$preValue = '';
$setsDate = array_keys($sets);
foreach($dateList as $i => $date)
{
$date = date('Y-m-d', strtotime($date));
$data .= isset($sets[$date]) ? "{$sets[$date]->value}," : "'',";
if($date > $now) break;
if(!isset($sets[$date]) and $sets)
{
$tmpDate = $setsDate;
$tmpDate[] = $date;
sort($tmpDate);
$tmpDateStr = ',' . join(',', $tmpDate);
$preDate = rtrim(substr($tmpDateStr, 0, strpos($tmpDateStr, $date)), ',');
$preDate = substr($preDate, strrpos($preDate, ',') + 1);
if($preDate)
{
$preValue = $sets[$preDate];
$preValue = $preValue->value;
}
}
$data .= isset($sets[$date]) ? "{$sets[$date]->value}," : "{$preValue},";
}
$data = rtrim($data, ',');
$data .= ']';

View File

@@ -440,7 +440,7 @@ class svnModel extends model
foreach($this->config->svn->repos as $repo)
{
if(empty($repo['path'])) continue;
if(strpos($url, $repo['path']) !== false) return (object)$repo;
if(strpos(strtolower($url), strtolower($repo['path'])) !== false) return (object)$repo;
}
return false;
}