protected function getExcludedURLSegments()
    {
        $excludes = [];

        // Build from rules
        foreach (Director::config()->get('rules') as $pattern => $rule) {
            $route = explode('/', $pattern);
            if (!empty($route) && strpos($route[0], '$') === false) {
                $excludes[] = strtolower($route[0]);
            }
        }

        // Build from base folders
        foreach (glob(Director::publicFolder() . '/*', GLOB_ONLYDIR) as $folder) {
            $excludes[] = strtolower(basename($folder));
        }

        $this->extend('updateExcludedURLSegments', $excludes);
        return $excludes;
    }
protected function getExcludedURLSegments()
    {
        $excludes = [];

        // Build from rules
        foreach (Director::config()->get('rules') as $pattern => $rule) {
            $route = explode('/', $pattern);
            if (!empty($route) && strpos($route[0], '$') === false) {
                $excludes[] = strtolower($route[0]);
            }
        }

        // Build from base folders
        foreach (glob(Director::publicFolder() . '/*', GLOB_ONLYDIR) as $folder) {
            $excludes[] = strtolower(basename($folder));
        }

        $this->extend('updateExcludedURLSegments', $excludes);
        return $excludes;
    }
protected function getExcludedURLSegments ( ) { $ excludes = [ ] ; // Build from rules foreach ( Director :: config ( ) -> get ( 'rules' ) as $ pattern => $ rule ) { $ route = explode ( '/' , $ pattern ) ; if ( ! empty ( $ route ) && strpos ( $ route [ 0 ] , '$' ) === false ) { $ excludes [ ] = strtolower ( $ route [ 0 ] ) ; } } // Build from base folders foreach ( glob ( Director :: publicFolder ( ) . '/*' , GLOB_ONLYDIR ) as $ folder ) { $ excludes [ ] = strtolower ( basename ( $ folder ) ) ; } $ this -> extend ( 'updateExcludedURLSegments' , $ excludes ) ; return $ excludes ; }
Get the list of excluded root URL segments

@return array List of lowercase urlsegments
Get the list of excluded root URL segments