Horde_Vfs_Base::getFolderSize PHP Method

getFolderSize() public method

Returns the size of a folder.
public getFolderSize ( string $path = null ) : integer
$path string The path of the folder.
return integer The size of the folder, in bytes.
    public function getFolderSize($path = null)
    {
        $size = 0;
        $root = !is_null($path) ? $path . '/' : '';
        $object_list = $this->listFolder($root, null, true, false, true);
        foreach ($object_list as $key => $val) {
            $size += isset($val['subdirs']) ? $this->getFolderSize($root . '/' . $key) : $this->size($root, $key);
        }
        return $size;
    }