Indefero

Indefero Commit Details


Date:2009-06-19 14:37:39 (15 years 6 months ago)
Author:Loic d'Anterroches
Branch:develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, release-1.1, release-1.2, release-1.3
Commit:6cf4f00f92205e0749e5c007b8a039e8f75c767b
Parents: d6c0b7a6802c9e5d5ae6fd9cccc51a1b1ce8f1cd
Message:Fixed to make the command portable on BSD/Solaris.

Changes:

File differences

src/IDF/Scm/Git.php
4343
4444
4545
46
46
4747
4848
49
49
5050
5151
5252
public function getRepositorySize()
{
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg($this->repo);
$out = split(' ', shell_exec($cmd), 2);
return (int) $out[0];
return (int) $out[0]*1024;
}
public function isAvailable()
src/IDF/Scm/Mercurial.php
3535
3636
3737
38
38
3939
4040
41
41
4242
4343
4444
public function getRepositorySize()
{
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg($this->repo);
$out = split(' ', shell_exec($cmd), 2);
return (int) $out[0];
return (int) $out[0]*1024;
}
public static function factory($project)
src/IDF/Scm/Svn.php
5656
5757
5858
59
59
6060
6161
62
62
6363
6464
6565
if (strpos($this->repo, 'file://') !== 0) {
return -1;
}
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg(substr($this->repo, 7));
$out = split(' ', shell_exec($cmd), 2);
return (int) $out[0];
return (int) $out[0]*1024;
}
/**
src/IDF/Views/Admin.php
319319
320320
321321
322
322
323323
324324
325
326
325
326
327327
328328
329
329
330330
331331
332332
$res['repositories'] += $size;
}
}
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg(Pluf::f('upload_path'));
$out = split(' ', shell_exec($cmd), 2);
$res['downloads'] = $out[0];
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -bs '
$res['downloads'] = $out[0]*1024;
$cmd = Pluf::f('idf_exec_cmd_prefix', '').'du -sk '
.escapeshellarg(Pluf::f('upload_issue_path'));
$out = split(' ', shell_exec($cmd), 2);
$res['attachments'] = $out[0];
$res['attachments'] = $out[0]*1024;
$res['total'] = $res['repositories'] + $res['downloads'] + $res['attachments'];
// TODO: now we need the db
return $res;

Archive Download the corresponding diff file

Page rendered in 0.08875s using 13 queries.