/** * Make sure that necessary base URIs are initialised properly. */ static public function initBaseURIs() { if ( self::$m_exporturl !== false ) return; global $wgContLang, $wgServer, $wgArticlePath; global $smwgNamespace; // complete namespace for URIs (with protocol, usually http://) if ( '' == $smwgNamespace ) { $resolver = SpecialPage::getTitleFor( 'URIResolver' ); $smwgNamespace = $resolver->getFullURL() . '/'; } elseif ( $smwgNamespace[0] == '.' ) { $resolver = SpecialPage::getTitleFor( 'URIResolver' ); $smwgNamespace = "http://" . substr( $smwgNamespace, 1 ) . $resolver->getLocalURL() . '/'; } // The article name must be the last part of wiki URLs for proper OWL/RDF export: self::$m_ent_wikiurl = $wgServer . str_replace( '$1', '', $wgArticlePath ); self::$m_ent_wiki = $smwgNamespace; self::$m_ent_property = self::$m_ent_wiki . self::encodeURI( urlencode( str_replace( ' ', '_', $wgContLang->getNsText( SMW_NS_PROPERTY ) . ':' ) ) ); $title = SpecialPage::getTitleFor( 'ExportRDF' ); self::$m_exporturl = self::$m_ent_wikiurl . $title->getPrefixedURL(); }
/** * Make sure that necessary base URIs are initialised properly. */ public static function initBaseURIs() { if (self::$m_exporturl !== false) { return; } global $wgContLang, $wgServer, $wgArticlePath; global $smwgNamespace; // complete namespace for URIs (with protocol, usually http://) if ('' == $smwgNamespace) { $resolver = SpecialPage::getTitleFor('URIResolver'); $smwgNamespace = $resolver->getFullURL() . '/'; } elseif ($smwgNamespace[0] == '.') { $resolver = SpecialPage::getTitleFor('URIResolver'); $smwgNamespace = "http://" . substr($smwgNamespace, 1) . $resolver->getLocalURL() . '/'; } // The article name must be the last part of wiki URLs for proper OWL/RDF export: self::$m_ent_wikiurl = $wgServer . str_replace('$1', '', $wgArticlePath); self::$m_ent_wiki = $smwgNamespace; $property = $GLOBALS['smwgExportBCNonCanonicalFormUse'] ? urlencode(str_replace(' ', '_', $wgContLang->getNsText(SMW_NS_PROPERTY))) : 'Property'; $category = $GLOBALS['smwgExportBCNonCanonicalFormUse'] ? urlencode(str_replace(' ', '_', $wgContLang->getNsText(NS_CATEGORY))) : 'Category'; self::$m_ent_property = self::$m_ent_wiki . Escaper::encodeUri($property . ':'); self::$m_ent_category = self::$m_ent_wiki . Escaper::encodeUri($category . ':'); $title = SpecialPage::getTitleFor('ExportRDF'); self::$m_exporturl = self::$m_ent_wikiurl . $title->getPrefixedURL(); }
/** * Make sure that necessary base URIs are initialised properly. */ public static function initBaseURIs() { if (self::$m_exporturl !== false) { return; } global $wgContLang, $wgServer, $wgArticlePath; global $smwgNamespace; // complete namespace for URIs (with protocol, usually http://) $resolver = Title::makeTitle(NS_SPECIAL, 'URIResolver'); if ('' == $smwgNamespace) { $smwgNamespace = $resolver->getFullURL() . '/'; } elseif ($smwgNamespace[0] == '.') { $smwgNamespace = "http://" . substr($smwgNamespace, 1) . $resolver->getLocalURL() . '/'; } // The article name must be the last part of wiki URLs for proper OWL/RDF export: self::$m_ent_wikiurl = $wgServer . str_replace('$1', '', $wgArticlePath); self::$m_ent_wiki = $smwgNamespace; $property = $GLOBALS['smwgExportBCNonCanonicalFormUse'] ? urlencode(str_replace(' ', '_', $wgContLang->getNsText(SMW_NS_PROPERTY))) : 'Property'; $category = $GLOBALS['smwgExportBCNonCanonicalFormUse'] ? urlencode(str_replace(' ', '_', $wgContLang->getNsText(NS_CATEGORY))) : 'Category'; self::$m_ent_property = self::$m_ent_wiki . Escaper::encodeUri($property . ':'); self::$m_ent_category = self::$m_ent_wiki . Escaper::encodeUri($category . ':'); $title = Title::makeTitle(NS_SPECIAL, 'ExportRDF'); self::$m_exporturl = self::$m_ent_wikiurl . $title->getPrefixedURL(); // Canonical form, the title object always contains a wgContLang reference // therefore replace it if (!$GLOBALS['smwgExportBCNonCanonicalFormUse']) { $localizer = Localizer::getInstance(); self::$m_ent_property = $localizer->getCanonicalizedUrlByNamespace(NS_SPECIAL, self::$m_ent_property); self::$m_ent_category = $localizer->getCanonicalizedUrlByNamespace(NS_SPECIAL, self::$m_ent_category); self::$m_ent_wiki = $localizer->getCanonicalizedUrlByNamespace(NS_SPECIAL, self::$m_ent_wiki); self::$m_exporturl = $localizer->getCanonicalizedUrlByNamespace(NS_SPECIAL, self::$m_exporturl); } }