public function directoryLength($directory = '')
    {
        if ($items = glob($this->rootDir .'/'. trim($directory, '/') .'/*')) {
            return count($items);
        }

        return 0;
    }
public function directoryLength($directory = '')
    {
        if ($items = glob($this->rootDir .'/'. trim($directory, '/') .'/*')) {
            return count($items);
        }

        return 0;
    }
public function directoryLength ( $ directory = '' ) { if ( $ items = glob ( $ this -> rootDir . '/' . trim ( $ directory , '/' ) . '/*' ) ) { return count ( $ items ) ; } return 0 ; }
count directory items

@param string $directory

@return integer
count directory items