SimpleSAML_Configuration::getBaseURL PHP Method

getBaseURL() public method

For example: simplesaml/ The path will always end with a '/' and never have a leading slash.
Deprecation: This method will be removed in SimpleSAMLphp 2.0. Please use getBasePath() instead.
public getBaseURL ( ) : string
return string The absolute path relative to the root of the website.
    public function getBaseURL()
    {
        if (!$this->deprecated_base_url_used) {
            $this->deprecated_base_url_used = true;
            SimpleSAML\Logger::warning("SimpleSAML_Configuration::getBaseURL() is deprecated, please use getBasePath() instead.");
        }
        if (preg_match('/^\\*(.*)$/D', $this->getString('baseurlpath', 'simplesaml/'), $matches)) {
            // deprecated behaviour, will be removed in the future
            return \SimpleSAML\Utils\HTTP::getFirstPathElement(false) . $matches[1];
        }
        return ltrim($this->getBasePath(), '/');
    }

Usage Example

コード例 #1
0
ファイル: Template.php プロジェクト: mrvanes/simplesamlphp
 /**
  * Constructor
  *
  * @param SimpleSAML_Configuration $configuration Configuration object
  * @param string                   $template Which template file to load
  * @param string|null              $defaultDictionary The default dictionary where tags will come from.
  */
 public function __construct(SimpleSAML_Configuration $configuration, $template, $defaultDictionary = null)
 {
     $this->configuration = $configuration;
     $this->template = $template;
     $this->data['baseurlpath'] = $this->configuration->getBaseURL();
     $this->translator = new SimpleSAML\Locale\Translate($configuration, $defaultDictionary);
 }