diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index 58792cc..6533ccf 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -43,10 +43,10 @@ class IDF_Scm_Git extends IDF_Scm 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() diff --git a/src/IDF/Scm/Mercurial.php b/src/IDF/Scm/Mercurial.php index 998e909..e8c8da7 100644 --- a/src/IDF/Scm/Mercurial.php +++ b/src/IDF/Scm/Mercurial.php @@ -35,10 +35,10 @@ class IDF_Scm_Mercurial extends IDF_Scm 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) diff --git a/src/IDF/Scm/Svn.php b/src/IDF/Scm/Svn.php index 00ab6d2..d9d1ef1 100644 --- a/src/IDF/Scm/Svn.php +++ b/src/IDF/Scm/Svn.php @@ -56,10 +56,10 @@ class IDF_Scm_Svn extends IDF_Scm 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; } /** diff --git a/src/IDF/Views/Admin.php b/src/IDF/Views/Admin.php index b101161..b4cda6e 100644 --- a/src/IDF/Views/Admin.php +++ b/src/IDF/Views/Admin.php @@ -319,14 +319,14 @@ function IDF_Views_Admin_getForgeSize() $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;