src/ministruts/Module.php
protected function setResourceBase(\SimpleXMLElement $xml) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        /** @var ConfigInterface $config */
        $config = $this->di('config');
        $rootDirectory = $config['app.dir.root'];

        if (!isset($xml['file-base'])) {
            // not specified, apply global configuration
            $location = $config->get('app.dir.view', null);
            if (!$location) throw new StrutsConfigException('Missing view directory configuration: '
                .'Neither $config[app.dir.view] nor <struts-config file-base="{base-directory}" are specified'.NL
                .'config: '.NL.$config->dump());
            isRelativePath($location) && $location = $rootDirectory.DIRECTORY_SEPARATOR.$location;
            if (!is_dir($location)) throw new StrutsConfigException('Resource location $config[app.dir.view]="'.$config['app.dir.view'].'" not found');

            $this->resourceLocations[] = realpath($location);
            return;
        }

        $locations = explode(',', (string) $xml['file-base']);

        foreach ($locations as $i => $location) {
            $location = trim($location);
            if (!strlen($location)) continue;

            isRelativePath($location) && $location = $rootDirectory.DIRECTORY_SEPARATOR.$location;
            if (!is_dir($location)) throw new StrutsConfigException('<struts-config file-base="'.$locations[$i].'": Resource location not found');

            $this->resourceLocations[] = realpath($location);
        }
    }
protected function setResourceBase(\SimpleXMLElement $xml) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        /** @var ConfigInterface $config */
        $config = $this->di('config');
        $rootDirectory = $config['app.dir.root'];

        if (!isset($xml['file-base'])) {
            // not specified, apply global configuration
            $location = $config->get('app.dir.view', null);
            if (!$location) throw new StrutsConfigException('Missing view directory configuration: '
                .'Neither $config[app.dir.view] nor <struts-config file-base="{base-directory}" are specified'.NL
                .'config: '.NL.$config->dump());
            isRelativePath($location) && $location = $rootDirectory.DIRECTORY_SEPARATOR.$location;
            if (!is_dir($location)) throw new StrutsConfigException('Resource location $config[app.dir.view]="'.$config['app.dir.view'].'" not found');

            $this->resourceLocations[] = realpath($location);
            return;
        }

        $locations = explode(',', (string) $xml['file-base']);

        foreach ($locations as $i => $location) {
            $location = trim($location);
            if (!strlen($location)) continue;

            isRelativePath($location) && $location = $rootDirectory.DIRECTORY_SEPARATOR.$location;
            if (!is_dir($location)) throw new StrutsConfigException('<struts-config file-base="'.$locations[$i].'": Resource location not found');

            $this->resourceLocations[] = realpath($location);
        }
    }
protected function setResourceBase ( \ SimpleXMLElement $ xml ) { if ( $ this -> configured ) throw new IllegalStateException ( 'Configuration is frozen' ) ; /** @var ConfigInterface $config */ $ config = $ this -> di ( 'config' ) ; $ rootDirectory = $ config [ 'app.dir.root' ] ; if ( ! isset ( $ xml [ 'file-base' ] ) ) { // not specified, apply global configuration $ location = $ config -> get ( 'app.dir.view' , null ) ; if ( ! $ location ) throw new StrutsConfigException ( 'Missing view directory configuration: ' . 'Neither $config[app.dir.view] nor <struts-config file-base="{base-directory}" are specified' . NL . 'config: ' . NL . $ config -> dump ( ) ) ; isRelativePath ( $ location ) && $ location = $ rootDirectory . DIRECTORY_SEPARATOR . $ location ; if ( ! is_dir ( $ location ) ) throw new StrutsConfigException ( 'Resource location $config[app.dir.view]="' . $ config [ 'app.dir.view' ] . '" not found' ) ; $ this -> resourceLocations [ ] = realpath ( $ location ) ; return ; } $ locations = explode ( ',' , ( string ) $ xml [ 'file-base' ] ) ; foreach ( $ locations as $ i => $ location ) { $ location = trim ( $ location ) ; if ( ! strlen ( $ location ) ) continue ; isRelativePath ( $ location ) && $ location = $ rootDirectory . DIRECTORY_SEPARATOR . $ location ; if ( ! is_dir ( $ location ) ) throw new StrutsConfigException ( '<struts-config file-base="' . $ locations [ $ i ] . '": Resource location not found' ) ; $ this -> resourceLocations [ ] = realpath ( $ location ) ; } }
Setzt das Basisverzeichnis fuer lokale Resourcen.

@param  \SimpleXMLElement $xml - XML-Objekt mit der Konfiguration

@throws StrutsConfigException on configuration errors
Setzt das Basisverzeichnis fuer lokale Resourcen .