当前位置: 首页>>代码示例>>PHP>>正文


PHP SMWExporter::decodeURI方法代码示例

本文整理汇总了PHP中SMWExporter::decodeURI方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWExporter::decodeURI方法的具体用法?PHP SMWExporter::decodeURI怎么用?PHP SMWExporter::decodeURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SMWExporter的用法示例。


在下文中一共展示了SMWExporter::decodeURI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 function execute($query)
 {
     global $wgOut;
     wfProfileIn('SpecialURIResolver::execute (SMW)');
     if (is_null($query) || trim($query) === '') {
         if (stristr($_SERVER['HTTP_ACCEPT'], 'RDF')) {
             $wgOut->redirect(SpecialPage::getTitleFor('ExportRDF')->getFullURL(array('stats' => '1')), '303');
         } else {
             $this->setHeaders();
             $wgOut->addHTML('<p>' . wfMessage('smw_uri_doc', 'http://www.w3.org/2001/tag/issues.html#httpRange-14')->parse() . '</p>');
         }
     } else {
         $query = SMWExporter::decodeURI($query);
         $query = str_replace('_', '%20', $query);
         $query = urldecode($query);
         $title = Title::newFromText($query);
         // In case the title doesn't exists throw an error page
         if ($title === null) {
             $wgOut->showErrorPage('badtitle', 'badtitletext');
         } else {
             $wgOut->redirect(stristr($_SERVER['HTTP_ACCEPT'], 'RDF') ? SpecialPage::getTitleFor('ExportRDF', $title->getPrefixedText())->getFullURL(array('xmlmime' => 'rdf')) : $title->getFullURL(), '303');
         }
     }
     wfProfileOut('SpecialURIResolver::execute (SMW)');
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:25,代码来源:SMW_SpecialURIResolver.php

示例2: execute

 function execute($query)
 {
     global $wgOut;
     wfProfileIn('SpecialURIResolver::execute (SMW)');
     if ($query === '') {
         if (stristr($_SERVER['HTTP_ACCEPT'], 'RDF')) {
             $wgOut->redirect(SpecialPage::getTitleFor('ExportRDF')->getFullURL('stats=1'), '303');
         } else {
             $this->setHeaders();
             $wgOut->addHTML('<p>' . wfMsg('smw_uri_doc') . "</p>");
         }
     } else {
         $query = SMWExporter::decodeURI($query);
         $query = str_replace("_", "%20", $query);
         $query = urldecode($query);
         $title = Title::newFromText($query);
         $wgOut->redirect(stristr($_SERVER['HTTP_ACCEPT'], 'RDF') ? SpecialPage::getTitleFor('ExportRDF', $title->getPrefixedText())->getFullURL('xmlmime=rdf') : $title->getFullURL(), '303');
     }
     wfProfileOut('SpecialURIResolver::execute (SMW)');
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:20,代码来源:SMW_SpecialURIResolver.php

示例3: createLink

 public static function createLink($link_mode, $uri)
 {
     global $smwgNamespace;
     $pos = strpos($uri, $smwgNamespace);
     if ($pos !== false) {
         $uri = SMWExporter::decodeURI($uri);
         $len = strlen($smwgNamespace);
         $page = substr($uri, $len);
         $page = str_replace("_", " ", $page);
         $is_category = strpos($page, "Category:") === false && strpos($page, "Category%3A") === false ? false : true;
         $link = "";
         if ($link_mode) {
             if ($is_category) {
                 $link = "[[:" . $page . "]]";
             } else {
                 $link = "[[" . $page . "]]";
             }
         } else {
             $link = $page;
         }
         return $link;
     }
     return $uri;
 }
开发者ID:alfredas,项目名称:SparqlExtension,代码行数:24,代码来源:SparqlLinker.php

示例4: efSparqlParserFunction_uri2Link

function efSparqlParserFunction_uri2Link($uri, $nowiki = false)
{
    //TODO : $title ??? CLEAN ?
    global $wgServer;
    $result = "";
    //$fromPatternThisWiki = "#^". str_replace( '.', '\.', $wgServer).".*:URIResolver/(.*)$#i";
    $fromPatternThisWiki = "#^" . str_replace('.', '\\.', $wgServer) . ".*:URIResolver/(?:(.*):(.*)|(.*))\$#i";
    $titleObj = null;
    $title = "";
    $forCategory = "";
    $isKnow = true;
    if (preg_match_all($fromPatternThisWiki, $uri, $match)) {
        $uri = SMWExporter::decodeURI($uri);
        $uri = str_replace("_", "%20", $uri);
        $uri = urldecode($uri);
        preg_match_all($fromPatternThisWiki, $uri, $match);
        if ($match[1][0] == '') {
            //no namespace
            $titleObj = Title::newFromText($match[3][0]);
            $title = $match[3][0];
        } else {
            global $wgContLang;
            $ns = $wgContLang->getNsIndex($match[1][0]);
            if (!$ns) {
                $isKnow = false;
            } else {
                $titleObj = Title::newFromText($match[2][0], $ns);
                $title = $match[2][0];
                if ($ns == NS_CATEGORY) {
                    $forCategory = ":";
                }
            }
        }
    } else {
        $isKnow = false;
    }
    if ($isKnow) {
        if ($nowiki) {
            if ($titleObj != null) {
                $result = $titleObj->getText();
            } else {
                $result = $title;
            }
        } else {
            if ($titleObj != null) {
                $result = "[[" . $forCategory . $titleObj->getPrefixedDBkey() . "|" . $titleObj->getText() . "]]";
            } else {
                $result = "[[" . $forCategory . $title . "]]";
            }
        }
    } else {
        $result = str_replace("=", "{{equal}}", $uri);
    }
    return $result;
}
开发者ID:aissatech,项目名称:LinkedWiki,代码行数:55,代码来源:LinkedWiki.php


注:本文中的SMWExporter::decodeURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。