Gitonomy\Git\Repository::getSize PHP Method

getSize() public method

Returns the size of repository, in kilobytes.
public getSize ( ) : integer
return integer A sum, in kilobytes
    public function getSize()
    {
        $process = ProcessBuilder::create(array('du', '-skc', $this->gitDir))->getProcess();
        $process->run();
        if (!preg_match('/(\\d+)\\s+total$/', trim($process->getOutput()), $vars)) {
            $message = sprintf("Unable to parse process output\ncommand: %s\noutput: %s", $process->getCommandLine(), $process->getOutput());
            if (null !== $this->logger) {
                $this->logger->error($message);
            }
            if (true === $this->debug) {
                throw new RuntimeException('unable to parse repository size output');
            }
            return;
        }
        return $vars[1];
    }