public static function getDirSizeCount($dir)
    {
        if (!is_dir($dir)) {
            throw new RuntimeException(sprintf('Invalid directory path supplied "%s"', $dir));
        }

        $count = 0.00;
        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));

        foreach ($iterator as $file) {
            $count += $file->getSize(); 
        }

        return $count;
    }
public static function getDirSizeCount($dir)
    {
        if (!is_dir($dir)) {
            throw new RuntimeException(sprintf('Invalid directory path supplied "%s"', $dir));
        }

        $count = 0.00;
        $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));

        foreach ($iterator as $file) {
            $count += $file->getSize(); 
        }

        return $count;
    }
public static function getDirSizeCount ( $ dir ) { if ( ! is_dir ( $ dir ) ) { throw new RuntimeException ( sprintf ( 'Invalid directory path supplied "%s"' , $ dir ) ) ; } $ count = 0.00 ; $ iterator = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ dir ) ) ; foreach ( $ iterator as $ file ) { $ count += $ file -> getSize ( ) ; } return $ count ; }
Counts directory size in bytes

@param string $dir
@throws \RuntimeException If invalid directory path supplied
@return float
Counts directory size in bytes