本文整理匯總了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++;
}