src/Security/Authorization.php
protected function parseFirewalls($force = false)
    {
        if (null == $this->firewalls || $force) {
            $firewalls = ['pattern'=>null,'paths'=>[]];
            $pattern = '';

            foreach (Base::instance()->get('SECURITY.firewalls') ?: [] as $name => $config) {
                $pattern .= ($pattern?'|':'').$config['path'];
                $key = static::pathName($config['path']);
                $firewalls['paths'][$key] = [
                    'login_route' => $config['login_route'],
                    'roles' => $config['roles'],
                ];
            }

            if ($pattern) {
                $firewalls['pattern'] = '#(?<path>'.$pattern.')#';
            }

            $this->firewalls = $firewalls;
        }
    }
protected function parseFirewalls($force = false)
    {
        if (null == $this->firewalls || $force) {
            $firewalls = ['pattern'=>null,'paths'=>[]];
            $pattern = '';

            foreach (Base::instance()->get('SECURITY.firewalls') ?: [] as $name => $config) {
                $pattern .= ($pattern?'|':'').$config['path'];
                $key = static::pathName($config['path']);
                $firewalls['paths'][$key] = [
                    'login_route' => $config['login_route'],
                    'roles' => $config['roles'],
                ];
            }

            if ($pattern) {
                $firewalls['pattern'] = '#(?<path>'.$pattern.')#';
            }

            $this->firewalls = $firewalls;
        }
    }
protected function parseFirewalls ( $ force = false ) { if ( null == $ this -> firewalls || $ force ) { $ firewalls = [ 'pattern' => null , 'paths' => [ ] ] ; $ pattern = '' ; foreach ( Base :: instance ( ) -> get ( 'SECURITY.firewalls' ) ? : [ ] as $ name => $ config ) { $ pattern .= ( $ pattern ? '|' : '' ) . $ config [ 'path' ] ; $ key = static :: pathName ( $ config [ 'path' ] ) ; $ firewalls [ 'paths' ] [ $ key ] = [ 'login_route' => $ config [ 'login_route' ] , 'roles' => $ config [ 'roles' ] , ] ; } if ( $ pattern ) { $ firewalls [ 'pattern' ] = '#(?<path>' . $ pattern . ')#' ; } $ this -> firewalls = $ firewalls ; } }
Parse firewalls from configuration
@param  boolean $force force parsing
@return void
Parse firewalls from configuration