InDefero

Sign in or create your account | Project List | Help

InDefero Commit Details

Date:2009-06-19 21:37:39 (1 year 2 months ago)
Author:Loïc d'Anterroches
Commit:6cf4f00f92205e0749e5c007b8a039e8f75c767b
Message:Fixed to make the command portable on BSD/Solaris.

Files: src/IDF/Scm/Git.php (1 diff)
src/IDF/Scm/Mercurial.php (1 diff)
src/IDF/Scm/Svn.php (1 diff)
src/IDF/Views/Admin.php (1 diff)

Change Details

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

Archive Download the corresponding diff file

Branches:
dev
develop
master
newdiff
svn

Tags:
v1.0