SimpleSAML_Configuration::getBaseDir PHP 메소드

getBaseDir() 공개 메소드

This function first checks the 'basedir' configuration option. If this option is undefined or null, then we fall back to looking at the current filename.
public getBaseDir ( ) : string
리턴 string The absolute path to the base directory for this SimpleSAMLphp installation. This path will always end with a slash.
    public function getBaseDir()
    {
        // check if a directory is configured in the configuration file
        $dir = $this->getString('basedir', null);
        if ($dir !== null) {
            // add trailing slash if it is missing
            if (substr($dir, -1) !== DIRECTORY_SEPARATOR) {
                $dir .= DIRECTORY_SEPARATOR;
            }
            return $dir;
        }
        // the directory wasn't set in the configuration file, path is <base directory>/lib/SimpleSAML/Configuration.php
        $dir = __FILE__;
        assert('basename($dir) === "Configuration.php"');
        $dir = dirname($dir);
        assert('basename($dir) === "SimpleSAML"');
        $dir = dirname($dir);
        assert('basename($dir) === "lib"');
        $dir = dirname($dir);
        // Add trailing directory separator
        $dir .= DIRECTORY_SEPARATOR;
        return $dir;
    }