本文整理汇总了PHP中WikiFactory::DBtoURL方法的典型用法代码示例。如果您正苦于以下问题:PHP WikiFactory::DBtoURL方法的具体用法?PHP WikiFactory::DBtoURL怎么用?PHP WikiFactory::DBtoURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WikiFactory
的用法示例。
在下文中一共展示了WikiFactory::DBtoURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
while ($row = $db->fetchRow($result)) {
$videoTitle = $row['img_name'];
echo "\n[Total: {$total} ({$cnt} of {$subTotal})] Video: {$videoTitle}\n";
// add URLs of pages where they are embedded for each video title
$query = new GlobalUsageQuery($videoTitle);
$query->execute();
$globalUsages = $query->getSingleImageResult();
if (empty($globalUsages)) {
$video = array($videoTitle, '');
writeToFile($video);
} else {
foreach ($globalUsages as $wiki => $articles) {
echo "\tGlobalUsages: Wiki: {$wiki}\n";
foreach ($articles as $article) {
echo "\t\tArticle: Namespace:{$article['namespace']}, Name:{$article['title']}\n";
$url = rtrim(WikiFactory::DBtoURL($article['wiki']), '/');
$title = Title::newFromText($article['title'], $article['namespace_id']);
if ($title instanceof Title) {
$url .= $title->getLocalURL();
echo "\t\t\tURL: {$url}\n";
}
$video = array($videoTitle, $url);
writeToFile($video);
$totalEmbed++;
}
}
}
$lastTitle = $row['img_name'];
$cnt++;
$total++;
}