Fixed some call-time pass-by-reference warnings with PHP 5.2.6.
This commit is contained in:
parent
7a0a0b523b
commit
c02c52b14a
@ -71,7 +71,7 @@ class IDF_Scm_Git
|
|||||||
escapeshellarg($this->repo),
|
escapeshellarg($this->repo),
|
||||||
escapeshellarg($hash));
|
escapeshellarg($hash));
|
||||||
$ret = 0; $out = array();
|
$ret = 0; $out = array();
|
||||||
IDF_Scm::exec($cmd, &$out, &$ret);
|
IDF_Scm::exec($cmd, $out, $ret);
|
||||||
if ($ret != 0) return false;
|
if ($ret != 0) return false;
|
||||||
return trim($out[0]);
|
return trim($out[0]);
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ class IDF_Scm_Git
|
|||||||
$rawlog = array();
|
$rawlog = array();
|
||||||
$cmd = sprintf('GIT_DIR=%s git log --raw --abbrev=40 --pretty=oneline %s',
|
$cmd = sprintf('GIT_DIR=%s git log --raw --abbrev=40 --pretty=oneline %s',
|
||||||
escapeshellarg($this->repo), escapeshellarg($commit));
|
escapeshellarg($this->repo), escapeshellarg($commit));
|
||||||
IDF_Scm::exec($cmd, &$rawlog);
|
IDF_Scm::exec($cmd, $rawlog);
|
||||||
// We reverse the log to be able to use a fixed efficient
|
// We reverse the log to be able to use a fixed efficient
|
||||||
// regex without back tracking.
|
// regex without back tracking.
|
||||||
$rawlog = implode("\n", array_reverse($rawlog));
|
$rawlog = implode("\n", array_reverse($rawlog));
|
||||||
@ -123,7 +123,7 @@ class IDF_Scm_Git
|
|||||||
// information as possible.
|
// information as possible.
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if ($file->type == 'blob' and preg_match('/^\:\d{6} \d{6} [0-9a-f]{40} '.$file->hash.' .*^([0-9a-f]{40})/msU',
|
if ($file->type == 'blob' and preg_match('/^\:\d{6} \d{6} [0-9a-f]{40} '.$file->hash.' .*^([0-9a-f]{40})/msU',
|
||||||
$rawlog, &$matches)) {
|
$rawlog, $matches)) {
|
||||||
$fc = $this->getCommit($matches[1]);
|
$fc = $this->getCommit($matches[1]);
|
||||||
$file->date = $fc->date;
|
$file->date = $fc->date;
|
||||||
$file->log = $fc->title;
|
$file->log = $fc->title;
|
||||||
@ -158,7 +158,7 @@ class IDF_Scm_Git
|
|||||||
escapeshellarg($tree));
|
escapeshellarg($tree));
|
||||||
$out = array();
|
$out = array();
|
||||||
$res = array();
|
$res = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
foreach ($out as $line) {
|
foreach ($out as $line) {
|
||||||
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
|
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
|
||||||
$res[] = (object) array('perm' => $perm, 'type' => $type,
|
$res[] = (object) array('perm' => $perm, 'type' => $type,
|
||||||
@ -183,7 +183,7 @@ class IDF_Scm_Git
|
|||||||
escapeshellarg($this->repo),
|
escapeshellarg($this->repo),
|
||||||
escapeshellarg($commit));
|
escapeshellarg($commit));
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
foreach ($out as $line) {
|
foreach ($out as $line) {
|
||||||
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
|
list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY);
|
||||||
if ($totest == $file) {
|
if ($totest == $file) {
|
||||||
@ -218,7 +218,7 @@ class IDF_Scm_Git
|
|||||||
{
|
{
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec(sprintf('GIT_DIR=%s git branch',
|
IDF_Scm::exec(sprintf('GIT_DIR=%s git branch',
|
||||||
escapeshellarg($this->repo)), &$out);
|
escapeshellarg($this->repo)), $out);
|
||||||
$res = array();
|
$res = array();
|
||||||
foreach ($out as $b) {
|
foreach ($out as $b) {
|
||||||
$res[] = substr($b, 2);
|
$res[] = substr($b, 2);
|
||||||
@ -239,7 +239,7 @@ class IDF_Scm_Git
|
|||||||
"'".$this->mediumtree_fmt."'",
|
"'".$this->mediumtree_fmt."'",
|
||||||
escapeshellarg($commit));
|
escapeshellarg($commit));
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
$log = array();
|
$log = array();
|
||||||
$change = array();
|
$change = array();
|
||||||
$inchange = false;
|
$inchange = false;
|
||||||
@ -274,7 +274,7 @@ class IDF_Scm_Git
|
|||||||
escapeshellarg($this->repo), $n, $this->mediumtree_fmt,
|
escapeshellarg($this->repo), $n, $this->mediumtree_fmt,
|
||||||
escapeshellarg($commit));
|
escapeshellarg($commit));
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
return self::parseLog($out, 4);
|
return self::parseLog($out, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class IDF_Scm_Mercurial
|
|||||||
escapeshellarg($hash));
|
escapeshellarg($hash));
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out, &$ret);
|
IDF_Scm::exec($cmd, $out, $ret);
|
||||||
return ($ret != 0) ? false : 'commit';
|
return ($ret != 0) ? false : 'commit';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ class IDF_Scm_Mercurial
|
|||||||
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : '');
|
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : '');
|
||||||
$out = array();
|
$out = array();
|
||||||
$res = array();
|
$res = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
$out_hack = array();
|
$out_hack = array();
|
||||||
foreach ($out as $line) {
|
foreach ($out as $line) {
|
||||||
list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4);
|
list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4);
|
||||||
@ -181,7 +181,7 @@ class IDF_Scm_Mercurial
|
|||||||
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit);
|
$cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit);
|
||||||
$out = array();
|
$out = array();
|
||||||
$res = array();
|
$res = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
$out_hack = array();
|
$out_hack = array();
|
||||||
foreach ($out as $line) {
|
foreach ($out as $line) {
|
||||||
list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4);
|
list($hash, $perm, $exec, $file) = preg_split('/ |\t/', $line, 4);
|
||||||
@ -246,7 +246,7 @@ class IDF_Scm_Mercurial
|
|||||||
{
|
{
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec(sprintf('hg branches -R %s',
|
IDF_Scm::exec(sprintf('hg branches -R %s',
|
||||||
escapeshellarg($this->repo)), &$out);
|
escapeshellarg($this->repo)), $out);
|
||||||
$res = array();
|
$res = array();
|
||||||
foreach ($out as $b) {
|
foreach ($out as $b) {
|
||||||
preg_match('/(\S+).*\S+:(\S+)/', $b, $match);
|
preg_match('/(\S+).*\S+:(\S+)/', $b, $match);
|
||||||
@ -266,7 +266,7 @@ class IDF_Scm_Mercurial
|
|||||||
|
|
||||||
$cmd = sprintf('hg log -p -r %s -R %s', escapeshellarg($commit), escapeshellarg($this->repo));
|
$cmd = sprintf('hg log -p -r %s -R %s', escapeshellarg($commit), escapeshellarg($this->repo));
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
$log = array();
|
$log = array();
|
||||||
$change = array();
|
$change = array();
|
||||||
$inchange = false;
|
$inchange = false;
|
||||||
@ -297,7 +297,7 @@ class IDF_Scm_Mercurial
|
|||||||
{
|
{
|
||||||
$cmd = sprintf('hg log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
|
$cmd = sprintf('hg log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit);
|
||||||
$out = array();
|
$out = array();
|
||||||
IDF_Scm::exec($cmd, &$out);
|
IDF_Scm::exec($cmd, $out);
|
||||||
return self::parseLog($out, 6);
|
return self::parseLog($out, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user