final protected static function getDirectoryStructure($rootDirectory, $exclude3rdParty = true)
    {
        $rootDirectory = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $rootDirectory), '/');
        if (!isset(self::$cache[__FUNCTION__])) {
            self::$cache[__FUNCTION__] = array();
        }
        $cacheKey = $rootDirectory.'*'.($exclude3rdParty ? '1' : '0');
        if (!isset(self::$cache[__FUNCTION__][$cacheKey])) {
            self::$cache[__FUNCTION__][$cacheKey] = static::getDirectoryStructureDo('', $rootDirectory, $exclude3rdParty);
        }

        return self::$cache[__FUNCTION__][$cacheKey];
    }
final protected static function getDirectoryStructure($rootDirectory, $exclude3rdParty = true)
    {
        $rootDirectory = rtrim(str_replace(DIRECTORY_SEPARATOR, '/', $rootDirectory), '/');
        if (!isset(self::$cache[__FUNCTION__])) {
            self::$cache[__FUNCTION__] = array();
        }
        $cacheKey = $rootDirectory.'*'.($exclude3rdParty ? '1' : '0');
        if (!isset(self::$cache[__FUNCTION__][$cacheKey])) {
            self::$cache[__FUNCTION__][$cacheKey] = static::getDirectoryStructureDo('', $rootDirectory, $exclude3rdParty);
        }

        return self::$cache[__FUNCTION__][$cacheKey];
    }
final protected static function getDirectoryStructure ( $ rootDirectory , $ exclude3rdParty = true ) { $ rootDirectory = rtrim ( str_replace ( DIRECTORY_SEPARATOR , '/' , $ rootDirectory ) , '/' ) ; if ( ! isset ( self :: $ cache [ __FUNCTION__ ] ) ) { self :: $ cache [ __FUNCTION__ ] = array ( ) ; } $ cacheKey = $ rootDirectory . '*' . ( $ exclude3rdParty ? '1' : '0' ) ; if ( ! isset ( self :: $ cache [ __FUNCTION__ ] [ $ cacheKey ] ) ) { self :: $ cache [ __FUNCTION__ ] [ $ cacheKey ] = static :: getDirectoryStructureDo ( '' , $ rootDirectory , $ exclude3rdParty ) ; } return self :: $ cache [ __FUNCTION__ ] [ $ cacheKey ] ; }
Returns the directory structure underneath a given directory.

@param string $rootDirectory        The root directory
@param bool   $exclude3rdParty=true Exclude concrete5 3rd party directories (namely directories called 'vendor' and '3rdparty')

@return array
Returns the directory structure underneath a given directory .