Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function getBaseUrl()
 {
     if (!$this->_properties->containsKey(self::$_PROPERTY_URL_BASE)) {
         /*
          * See if it was defined in boot settings.
          */
         $fromBootSettings = $this->_bootSettings->getUrlBase();
         if ($fromBootSettings) {
             $this->_properties->put(self::$_PROPERTY_URL_BASE, $fromBootSettings);
             return $fromBootSettings;
         }
         if (!$this->_isWordPress()) {
             throw new RuntimeException('Please specify TubePress base URL in tubepress-content/config/settings.php');
         }
         $baseName = basename(TUBEPRESS_ROOT);
         $prefix = $this->_getWpContentUrl();
         $url = rtrim($prefix, '/') . "/plugins/{$baseName}";
         $url = $this->_toUrl($url);
         $this->_properties->put(self::$_PROPERTY_URL_BASE, $url);
     }
     return $this->_properties->get(self::$_PROPERTY_URL_BASE);
 }